diff options
author | Rob Landley <rob@landley.net> | 2005-11-01 21:55:14 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2005-11-01 21:55:14 +0000 |
commit | 2f30932eca235c9ff581f78c989e9d93ae9ca78f (patch) | |
tree | f11d140c54335ce8af9b76574fb699d62901856f /coreutils/cp.c | |
parent | dbc608b5687ebe1b828f921c70573280d6c3e313 (diff) | |
download | busybox-w32-2f30932eca235c9ff581f78c989e9d93ae9ca78f.tar.gz busybox-w32-2f30932eca235c9ff581f78c989e9d93ae9ca78f.tar.bz2 busybox-w32-2f30932eca235c9ff581f78c989e9d93ae9ca78f.zip |
Fix cp /dev/null filename, and a few in-passing cleanups.
Diffstat (limited to 'coreutils/cp.c')
-rw-r--r-- | coreutils/cp.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c index eaabee4f4..ac572548f 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c | |||
@@ -4,20 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (C) 2000 by Matt Kraai <kraai@alumni.carnegiemellon.edu> | 5 | * Copyright (C) 2000 by Matt Kraai <kraai@alumni.carnegiemellon.edu> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * Licensed under GPL v2 or later, see file LICENSE in this tarball for details. |
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | 8 | */ |
22 | 9 | ||
23 | /* BB_AUDIT SUSv3 defects - unsupported options -H, -L, and -P. */ | 10 | /* BB_AUDIT SUSv3 defects - unsupported options -H, -L, and -P. */ |
@@ -41,9 +28,6 @@ | |||
41 | #include "busybox.h" | 28 | #include "busybox.h" |
42 | #include "libcoreutils/coreutils.h" | 29 | #include "libcoreutils/coreutils.h" |
43 | 30 | ||
44 | /* WARNING!! ORDER IS IMPORTANT!! */ | ||
45 | static const char cp_opts[] = "pdRfiarPHL"; | ||
46 | |||
47 | extern int cp_main(int argc, char **argv) | 31 | extern int cp_main(int argc, char **argv) |
48 | { | 32 | { |
49 | struct stat source_stat; | 33 | struct stat source_stat; |
@@ -55,14 +39,7 @@ extern int cp_main(int argc, char **argv) | |||
55 | int flags; | 39 | int flags; |
56 | int status = 0; | 40 | int status = 0; |
57 | 41 | ||
58 | /* Since these are enums, #if tests will not work. So use assert()s. */ | 42 | flags = bb_getopt_ulflags(argc, argv, "pdRfiarPHL"); |
59 | assert(FILEUTILS_PRESERVE_STATUS == 1); | ||
60 | assert(FILEUTILS_DEREFERENCE == 2); | ||
61 | assert(FILEUTILS_RECUR == 4); | ||
62 | assert(FILEUTILS_FORCE == 8); | ||
63 | assert(FILEUTILS_INTERACTIVE == 16); | ||
64 | |||
65 | flags = bb_getopt_ulflags(argc, argv, cp_opts); | ||
66 | 43 | ||
67 | if (flags & 32) { | 44 | if (flags & 32) { |
68 | flags |= (FILEUTILS_PRESERVE_STATUS | FILEUTILS_RECUR | FILEUTILS_DEREFERENCE); | 45 | flags |= (FILEUTILS_PRESERVE_STATUS | FILEUTILS_RECUR | FILEUTILS_DEREFERENCE); |