소스 검색

(from_chars): Skip only the initial null byte from buggy tars, so that
we don't complain about all-null fields.

Paul Eggert 26 년 전
부모
커밋
22ee808ffe
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      src/list.c

+ 7 - 4
src/list.c

@@ -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++;
     }