]> Dogcows Code - chaz/tar/blobdiff - src/misc.c
Fix --remove-files in update/append mode.
[chaz/tar] / src / misc.c
index 34fa6e61fe0bb3125e96487c4e8962ee1d8646e3..6f67887fab6d0f83829974d3eaa4b75353b399f7 100644 (file)
@@ -50,6 +50,9 @@ assign_string (char **string, const char *value)
   *string = value ? xstrdup (value) : 0;
 }
 
+#if 0
+/* This function is currently unused; perhaps it should be removed?  */
+
 /* Allocate a copy of the string quoted as in C, and returns that.  If
    the string does not have to be quoted, it returns a null pointer.
    The allocated copy should normally be freed with free() after the
@@ -62,7 +65,7 @@ assign_string (char **string, const char *value)
    when reading directory files.  This means that we can't use
    quotearg, as quotearg is locale-dependent and is meant for human
    consumption.  */
-char *
+static char *
 quote_copy_string (const char *string)
 {
   const char *source = string;
@@ -103,6 +106,7 @@ quote_copy_string (const char *string)
     }
   return 0;
 }
+#endif
 
 /* Takes a quoted C string (like those produced by quote_copy_string)
    and turns it back into the un-quoted original.  This is done in
@@ -648,7 +652,7 @@ struct wd
      value if it was not saved successfully.  */
   int err;
 
-  /* The saved version of the directory, if SAVED == 1.  */
+  /* The saved version of the directory, if ERR == 0.  */
   struct saved_cwd saved_cwd;
 };
 
@@ -708,16 +712,17 @@ chdir_arg (char const *dir)
   return wd_count++;
 }
 
+/* Index of current directory.  */
+int chdir_current;
+
 /* Change to directory I.  If I is 0, change to the initial working
    directory; otherwise, I must be a value returned by chdir_arg.  */
 void
 chdir_do (int i)
 {
-  static int previous;
-
-  if (previous != i)
+  if (chdir_current != i)
     {
-      struct wd *prev = &wd[previous];
+      struct wd *prev = &wd[chdir_current];
       struct wd *curr = &wd[i];
 
       if (prev->err < 0)
@@ -762,7 +767,7 @@ chdir_do (int i)
            chdir_fatal (curr->name);
        }
 
-      previous = i;
+      chdir_current = i;
     }
 }
 \f
This page took 0.023807 seconds and 4 git commands to generate.