add externals, minor cleanups
SCCS-vsn: usr.bin/ar/extract.c 5.4
-static char sccsid[] = "@(#)extract.c 5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)extract.c 5.4 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
extern CHDR chdr; /* converted header */
extern char *archive; /* archive name */
extern CHDR chdr; /* converted header */
extern char *archive; /* archive name */
for (all = !*argv; get_header(afd);) {
if (all)
file = chdr.name;
for (all = !*argv; get_header(afd);) {
if (all)
file = chdr.name;
- else {
- file = *argv;
- if (!files(argv)) {
- skipobj(afd);
- continue;
- }
+ else if (!(file = files(argv))) {
+ skipobj(afd);
+ continue;
}
if (options & AR_U && !stat(file, &sb) &&
}
if (options & AR_U && !stat(file, &sb) &&
if (!all && !*argv)
break;
}
if (!all && !*argv)
break;
}
+
+ if (*argv) {
+ orphans(argv);
+ return(1);
+ }
+ return(0);