mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Merge r668 from libarchive.googlecode.com: Style correction to the
'ar' reader: Don't redefine 'isdigit' and don't create a macro that's only used once.
This commit is contained in:
parent
f7c755c1db
commit
b7baebb91a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189440
|
@ -72,8 +72,6 @@ struct ar {
|
|||
#define AR_fmag_offset 58
|
||||
#define AR_fmag_size 2
|
||||
|
||||
#define isdigit(x) (x) >= '0' && (x) <= '9'
|
||||
|
||||
static int archive_read_format_ar_bid(struct archive_read *a);
|
||||
static int archive_read_format_ar_cleanup(struct archive_read *a);
|
||||
static int archive_read_format_ar_read_data(struct archive_read *a,
|
||||
|
@ -309,8 +307,10 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|||
/*
|
||||
* GNU variant handles long filenames by storing /<number>
|
||||
* to indicate a name stored in the filename table.
|
||||
* XXX TODO: Verify that it's all digits... Don't be fooled
|
||||
* by "/9xyz" XXX
|
||||
*/
|
||||
if (filename[0] == '/' && isdigit(filename[1])) {
|
||||
if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
|
||||
number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
|
||||
/*
|
||||
* If we can't look up the real name, warn and return
|
||||
|
|
Loading…
Reference in a new issue