| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: options.c,v 1.105 2009/07/13 19:05:39 roy Exp $ */ | | 1 | /* $NetBSD: options.c,v 1.106 2009/12/14 05:04:48 dholland Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1992 Keith Muller. | | 4 | * Copyright (c) 1992 Keith Muller. |
5 | * Copyright (c) 1992, 1993 | | 5 | * Copyright (c) 1992, 1993 |
6 | * The Regents of the University of California. All rights reserved. | | 6 | * The Regents of the University of California. All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to Berkeley by | | 8 | * This code is derived from software contributed to Berkeley by |
9 | * Keith Muller of the University of California, San Diego. | | 9 | * Keith Muller of the University of California, San Diego. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
33 | * SUCH DAMAGE. | | 33 | * SUCH DAMAGE. |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | #if HAVE_NBTOOL_CONFIG_H | | 36 | #if HAVE_NBTOOL_CONFIG_H |
37 | #include "nbtool_config.h" | | 37 | #include "nbtool_config.h" |
38 | #endif | | 38 | #endif |
39 | | | 39 | |
40 | #include <sys/cdefs.h> | | 40 | #include <sys/cdefs.h> |
41 | #if !defined(lint) | | 41 | #if !defined(lint) |
42 | #if 0 | | 42 | #if 0 |
43 | static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; | | 43 | static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; |
44 | #else | | 44 | #else |
45 | __RCSID("$NetBSD: options.c,v 1.105 2009/07/13 19:05:39 roy Exp $"); | | 45 | __RCSID("$NetBSD: options.c,v 1.106 2009/12/14 05:04:48 dholland Exp $"); |
46 | #endif | | 46 | #endif |
47 | #endif /* not lint */ | | 47 | #endif /* not lint */ |
48 | | | 48 | |
49 | #include <sys/types.h> | | 49 | #include <sys/types.h> |
50 | #include <sys/time.h> | | 50 | #include <sys/time.h> |
51 | #include <sys/stat.h> | | 51 | #include <sys/stat.h> |
52 | #include <sys/param.h> | | 52 | #include <sys/param.h> |
53 | #include <ctype.h> | | 53 | #include <ctype.h> |
54 | #include <errno.h> | | 54 | #include <errno.h> |
55 | #if HAVE_NBTOOL_CONFIG_H | | 55 | #if HAVE_NBTOOL_CONFIG_H |
56 | #include "compat_getopt.h" | | 56 | #include "compat_getopt.h" |
57 | #else | | 57 | #else |
58 | #include <getopt.h> | | 58 | #include <getopt.h> |
| @@ -682,27 +682,27 @@ pax_options(int argc, char **argv) | | | @@ -682,27 +682,27 @@ pax_options(int argc, char **argv) |
682 | * did not specify a format. when we write during an APPEND, we will | | 682 | * did not specify a format. when we write during an APPEND, we will |
683 | * adopt the format of the existing archive if none was supplied. | | 683 | * adopt the format of the existing archive if none was supplied. |
684 | */ | | 684 | */ |
685 | if (!(flg & XF) && (act == ARCHIVE)) | | 685 | if (!(flg & XF) && (act == ARCHIVE)) |
686 | frmt = &(fsub[DEFLT]); | | 686 | frmt = &(fsub[DEFLT]); |
687 | | | 687 | |
688 | /* | | 688 | /* |
689 | * process the args as they are interpreted by the operation mode | | 689 | * process the args as they are interpreted by the operation mode |
690 | */ | | 690 | */ |
691 | switch (act) { | | 691 | switch (act) { |
692 | case LIST: | | 692 | case LIST: |
693 | case EXTRACT: | | 693 | case EXTRACT: |
694 | for (; optind < argc; optind++) | | 694 | for (; optind < argc; optind++) |
695 | if (pat_add(argv[optind], NULL, NOGLOB_MTCH) < 0) | | 695 | if (pat_add(argv[optind], NULL, 0) < 0) |
696 | pax_usage(); | | 696 | pax_usage(); |
697 | break; | | 697 | break; |
698 | case COPY: | | 698 | case COPY: |
699 | if (optind >= argc) { | | 699 | if (optind >= argc) { |
700 | tty_warn(0, "Destination directory was not supplied"); | | 700 | tty_warn(0, "Destination directory was not supplied"); |
701 | pax_usage(); | | 701 | pax_usage(); |
702 | } | | 702 | } |
703 | --argc; | | 703 | --argc; |
704 | dirptr = argv[argc]; | | 704 | dirptr = argv[argc]; |
705 | if (mkpath(dirptr) < 0) | | 705 | if (mkpath(dirptr) < 0) |
706 | exit(1); | | 706 | exit(1); |
707 | /* FALLTHROUGH */ | | 707 | /* FALLTHROUGH */ |
708 | case ARCHIVE: | | 708 | case ARCHIVE: |