]> Dogcows Code - chaz/tar/commitdiff
(from_chars): Skip only the initial null byte from buggy tars, so that
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Aug 1999 09:24:42 +0000 (09:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Aug 1999 09:24:42 +0000 (09:24 +0000)
we don't complain about all-null fields.

src/list.c

index 2109d8fe36e370e36633e1ff69d868175f6b9db8..43c858caaf5de989f78de641eb1be3357618da11 100644 (file)
@@ -512,19 +512,22 @@ from_chars (char const *where0, size_t digs, char const *type,
   char const *lim = where + digs;
   int negative = 0;
 
-  /* Accommodate older tars, which output leading spaces, and at least one
-     buggy tar, which outputs leading NUL if the previous field overflows.  */
+  /* Accommodate buggy tar of unknown vintage, which outputs leading
+     NUL if the previous field overflows.  */
+  where += !*where;
+
+  /* Accommodate older tars, which output leading spaces.  */
   for (;;)
     {
       if (where == lim)
        {
          if (type)
            ERROR ((0, 0,
-                   _("Empty header where numeric %s value expected"),
+                   _("Blanks in header where numeric %s value expected"),
                    type));
          return -1;
        }
-      if (!ISSPACE ((unsigned char) *where) && *where)
+      if (!ISSPACE ((unsigned char) *where))
        break;
       where++;
     }
This page took 0.025351 seconds and 4 git commands to generate.