replace_prefix (&dp->name, pref, pref_len, repl, repl_len);
}
+void
+clear_directory_table (void)
+{
+ struct directory *dp;
+
+ if (directory_table)
+ hash_clear (directory_table);
+ if (directory_meta_table)
+ hash_clear (directory_meta_table);
+ for (dp = dirhead; dp; )
+ {
+ struct directory *next = dp->next;
+ free_directory (dp);
+ dp = next;
+ }
+ dirhead = dirtail = NULL;
+}
+
/* Create and link a new directory entry for directory NAME, having a
device number DEV and an inode number INO, with NFS indicating
whether it is an NFS device and FOUND indicating whether we have
if (! ((directory_table
|| (directory_table = hash_initialize (0, 0,
hash_directory_canonical_name,
- compare_directory_canonical_names, 0)))
+ compare_directory_canonical_names,
+ 0)))
&& hash_insert (directory_table, directory)))
xalloc_die ();
{
struct directory *directory;
struct stat *stat_data = &st->stat;
- dev_t device = st->parent ? st->parent->stat.st_dev : 0;
bool nfs = NFS_FILE_STAT (*stat_data);
if ((directory = find_directory (name_buffer)) != NULL)
}
}
- /* If the directory is on another device and --one-file-system was given,
- omit it... */
- if (one_file_system_option && device != stat_data->st_dev
- /* ... except if it was explicitely given in the command line */
- && !is_individual_file (name_buffer))
+ if (one_file_system_option && st->parent
+ && stat_data->st_dev != st->parent->stat.st_dev)
/* FIXME:
WARNOPT (WARN_XDEV,
(0, 0,
namebuf_free (nbuf);
- if (dirp)
- free (dirp);
+ free (dirp);
return directory;
}
if (ferror (listed_incremental_stream))
read_error (listed_incremental_option);
- if (buf)
- free (buf);
+ free (buf);
}
/* Output incremental data for the directory ENTRY to the file DATA.
{
const char *entry;
struct stat st;
- if (p)
- free (p);
+ free (p);
p = new_name (directory_name, cur);
if (deref_stat (p, &st) != 0)