| 51 |
return NULL; |
return NULL; |
| 52 |
} |
} |
| 53 |
|
|
| 54 |
|
/* Decodes a single extended header record. Advances P to the next |
| 55 |
|
record. |
| 56 |
|
Returns true on success, false otherwise. */ |
| 57 |
static bool |
static bool |
| 58 |
decode_record (char **p, struct tar_stat_info *st) |
decode_record (char **p, struct tar_stat_info *st) |
| 59 |
{ |
{ |
| 64 |
struct xhdr_tab const *t; |
struct xhdr_tab const *t; |
| 65 |
|
|
| 66 |
if (**p == 0) |
if (**p == 0) |
| 67 |
return true; |
return false; |
| 68 |
|
|
| 69 |
len = strtoul (*p, p, 10); |
len = strtoul (*p, p, 10); |
| 70 |
if (**p != ' ') |
if (**p != ' ') |
| 71 |
{ |
{ |
| 72 |
ERROR ((0, 0, _("Malformed extended header"))); |
ERROR ((0, 0, _("Malformed extended header: missing whitespace after the length"))); |
| 73 |
return true; |
return false; |
| 74 |
} |
} |
| 75 |
|
|
| 76 |
keyword = ++*p; |
keyword = ++*p; |
| 80 |
|
|
| 81 |
if (**p != '=') |
if (**p != '=') |
| 82 |
{ |
{ |
| 83 |
ERROR ((0, 0, _("Malformed extended header"))); |
ERROR ((0, 0, _("Malformed extended header: missing equal sign"))); |
| 84 |
return true; |
return false; |
| 85 |
} |
} |
| 86 |
|
|
| 87 |
eqp = *p; |
eqp = *p; |
| 101 |
} |
} |
| 102 |
*eqp = '='; |
*eqp = '='; |
| 103 |
*p = &start[len]; |
*p = &start[len]; |
| 104 |
return false; |
return true; |
| 105 |
} |
} |
| 106 |
|
|
| 107 |
void |
void |
| 111 |
char *endp = &extended_header.buffer[extended_header.size-1]; |
char *endp = &extended_header.buffer[extended_header.size-1]; |
| 112 |
|
|
| 113 |
while (p < endp) |
while (p < endp) |
| 114 |
if (decode_record (&p, st)) |
if (!decode_record (&p, st)) |
| 115 |
break; |
break; |
| 116 |
} |
} |
| 117 |
|
|