From 22ee808ffee0bd9b5f70649166863620059131d8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 18 Aug 1999 09:24:42 +0000 Subject: [PATCH] (from_chars): Skip only the initial null byte from buggy tars, so that we don't complain about all-null fields. --- src/list.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/list.c b/src/list.c index 2109d8f..43c858c 100644 --- a/src/list.c +++ b/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++; } -- 2.45.2