return NULL;
}
+/* Decodes a single extended header record. Advances P to the next
+ record.
+ Returns true on success, false otherwise. */
static bool
decode_record (char **p, struct tar_stat_info *st)
{
struct xhdr_tab const *t;
if (**p == 0)
- return true;
+ return false;
len = strtoul (*p, p, 10);
if (**p != ' ')
{
- ERROR ((0, 0, _("Malformed extended header")));
- return true;
+ ERROR ((0, 0, _("Malformed extended header: missing whitespace after the length")));
+ return false;
}
keyword = ++*p;
if (**p != '=')
{
- ERROR ((0, 0, _("Malformed extended header")));
- return true;
+ ERROR ((0, 0, _("Malformed extended header: missing equal sign")));
+ return false;
}
eqp = *p;
}
*eqp = '=';
*p = &start[len];
- return false;
+ return true;
}
void
char *endp = &extended_header.buffer[extended_header.size-1];
while (p < endp)
- if (decode_record (&p, st))
+ if (!decode_record (&p, st))
break;
}