]> Dogcows Code - chaz/tar/commitdiff
(find_directory_meta): Bugfix
authorSergey Poznyakoff <gray@gnu.org.ua>
Sat, 13 May 2006 08:38:12 +0000 (08:38 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Sat, 13 May 2006 08:38:12 +0000 (08:38 +0000)
src/incremen.c

index d354efa2bde79a725a4ee4292228847664116c42..eadd80fb056065e8baa4116d7af33c52c3094f8f 100644 (file)
@@ -196,9 +196,10 @@ find_directory_meta (dev_t dev, ino_t ino)
   else
     {
       struct directory *dir = make_directory ("");
+      struct directory *ret;
       dir->device_number = dev;
       dir->inode_number = ino;
-      struct directory *ret = hash_lookup (directory_meta_table, dir);
+      ret = hash_lookup (directory_meta_table, dir);
       free (dir);
       return ret;
     }
@@ -1219,13 +1220,16 @@ purge_directory (char const *directory_name)
   p = NULL;
   for (cur = current_dir; *cur; cur += strlen (cur) + 1)
     {
-      if (!dumpdir_locate (current_stat_info.dumpdir, cur))
-       {
-         struct stat st;
-         if (p)
-           free (p);
-         p = new_name (directory_name, cur);
+      const char *entry;
+      struct stat st;
+      if (p)
+       free (p);
+      p = new_name (directory_name, cur);
 
+      if (!(entry = dumpdir_locate (current_stat_info.dumpdir, cur))
+         || (*entry == 'D' && S_ISDIR (st.st_mode))
+         || (*entry == 'Y' && !S_ISDIR (st.st_mode)))
+       {
          if (deref_stat (false, p, &st))
            {
              if (errno != ENOENT) /* FIXME: Maybe keep a list of renamed
This page took 0.026891 seconds and 4 git commands to generate.