mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-25 13:41:45 +00:00
(ar_scan) [AIAMAG]: Check for zero MEMBER_OFFSET, indicating a valid, but
empty, archive.
This commit is contained in:
parent
ee2b67af6d
commit
70465ffcfb
1 changed files with 8 additions and 1 deletions
9
arscan.c
9
arscan.c
|
@ -1,5 +1,5 @@
|
|||
/* Library function for scanning an archive file.
|
||||
Copyright (C) 1987, 89, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 89, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -144,6 +144,13 @@ ar_scan (archive, function, arg)
|
|||
|
||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||
|
||||
if (member_offset == 0)
|
||||
{
|
||||
/* Empty archive. */
|
||||
close (desc);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#ifndef M_XENIX
|
||||
register long int member_offset = sizeof (int);
|
||||
|
|
Loading…
Reference in a new issue