diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/cp.c | 2 | ||||
-rw-r--r-- | coreutils/cut.c | 2 | ||||
-rw-r--r-- | coreutils/date.c | 2 | ||||
-rw-r--r-- | coreutils/dos2unix.c | 22 | ||||
-rw-r--r-- | coreutils/id.c | 2 | ||||
-rw-r--r-- | coreutils/install.c | 2 | ||||
-rw-r--r-- | coreutils/sort.c | 2 |
7 files changed, 15 insertions, 19 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c index f98f281b5..78bd73c0f 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c | |||
@@ -44,7 +44,7 @@ int cp_main(int argc, char **argv) | |||
44 | // -P and -d are the same (-P is POSIX, -d is GNU) | 44 | // -P and -d are the same (-P is POSIX, -d is GNU) |
45 | // -r and -R are the same | 45 | // -r and -R are the same |
46 | // -a = -pdR | 46 | // -a = -pdR |
47 | opt_complementary = "?:l--s:s--l:Pd:rR:apdR"; | 47 | opt_complementary = "l--s:s--l:Pd:rR:apdR"; |
48 | flags = getopt32(argc, argv, FILEUTILS_CP_OPTSTR "arPHL"); | 48 | flags = getopt32(argc, argv, FILEUTILS_CP_OPTSTR "arPHL"); |
49 | /* Default behavior of cp is to dereference, so we don't have to do | 49 | /* Default behavior of cp is to dereference, so we don't have to do |
50 | * anything special when we are given -L. | 50 | * anything special when we are given -L. |
diff --git a/coreutils/cut.c b/coreutils/cut.c index 084f7be37..435b21070 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c | |||
@@ -176,8 +176,6 @@ int cut_main(int argc, char **argv) | |||
176 | argv += optind; | 176 | argv += optind; |
177 | if (!(option_mask32 & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS))) | 177 | if (!(option_mask32 & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS))) |
178 | bb_error_msg_and_die("expected a list of bytes, characters, or fields"); | 178 | bb_error_msg_and_die("expected a list of bytes, characters, or fields"); |
179 | if (option_mask32 & BB_GETOPT_ERROR) | ||
180 | bb_error_msg_and_die("only one type of list may be specified"); | ||
181 | 179 | ||
182 | if (option_mask32 & CUT_OPT_DELIM_FLGS) { | 180 | if (option_mask32 & CUT_OPT_DELIM_FLGS) { |
183 | if (strlen(ltok) > 1) { | 181 | if (strlen(ltok) > 1) { |
diff --git a/coreutils/date.c b/coreutils/date.c index 1b20cd443..5e2bcee3b 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -51,7 +51,7 @@ int date_main(int argc, char **argv) | |||
51 | char *isofmt_arg; | 51 | char *isofmt_arg; |
52 | char *hintfmt_arg; | 52 | char *hintfmt_arg; |
53 | 53 | ||
54 | opt_complementary = "?:d--s:s--d" | 54 | opt_complementary = "d--s:s--d" |
55 | USE_FEATURE_DATE_ISOFMT(":R--I:I--R"); | 55 | USE_FEATURE_DATE_ISOFMT(":R--I:I--R"); |
56 | opt = getopt32(argc, argv, "Rs:ud:r:" | 56 | opt = getopt32(argc, argv, "Rs:ud:r:" |
57 | USE_FEATURE_DATE_ISOFMT("I::D:"), | 57 | USE_FEATURE_DATE_ISOFMT("I::D:"), |
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index 86adcd91f..115632f75 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c | |||
@@ -20,7 +20,7 @@ enum { | |||
20 | }; | 20 | }; |
21 | 21 | ||
22 | /* if fn is NULL then input is stdin and output is stdout */ | 22 | /* if fn is NULL then input is stdin and output is stdout */ |
23 | static int convert(char *fn, int ConvType) | 23 | static int convert(char *fn, int conv_type) |
24 | { | 24 | { |
25 | FILE *in, *out; | 25 | FILE *in, *out; |
26 | int i; | 26 | int i; |
@@ -52,7 +52,7 @@ static int convert(char *fn, int ConvType) | |||
52 | if (i == '\r') | 52 | if (i == '\r') |
53 | continue; | 53 | continue; |
54 | if (i == '\n') { | 54 | if (i == '\n') { |
55 | if (ConvType == CT_UNIX2DOS) | 55 | if (conv_type == CT_UNIX2DOS) |
56 | fputc('\r', out); | 56 | fputc('\r', out); |
57 | fputc('\n', out); | 57 | fputc('\n', out); |
58 | continue; | 58 | continue; |
@@ -81,29 +81,27 @@ static int convert(char *fn, int ConvType) | |||
81 | int dos2unix_main(int argc, char **argv); | 81 | int dos2unix_main(int argc, char **argv); |
82 | int dos2unix_main(int argc, char **argv) | 82 | int dos2unix_main(int argc, char **argv) |
83 | { | 83 | { |
84 | int o, ConvType; | 84 | int o, conv_type; |
85 | 85 | ||
86 | /* See if we are supposed to be doing dos2unix or unix2dos */ | 86 | /* See if we are supposed to be doing dos2unix or unix2dos */ |
87 | if (applet_name[0] == 'd') { | 87 | if (applet_name[0] == 'd') { |
88 | ConvType = CT_DOS2UNIX; /* 2 */ | 88 | conv_type = CT_DOS2UNIX; /* 2 */ |
89 | } else { | 89 | } else { |
90 | ConvType = CT_UNIX2DOS; /* 1 */ | 90 | conv_type = CT_UNIX2DOS; /* 1 */ |
91 | } | 91 | } |
92 | /* -u and -d are mutally exclusive */ | 92 | |
93 | opt_complementary = "?:u--d:d--u"; | 93 | /* -u convert to unix, -d convert to dos */ |
94 | /* process parameters */ | 94 | opt_complementary = "u--d:d--u"; /* mutally exclusive */ |
95 | /* -u convert to unix */ | ||
96 | /* -d convert to dos */ | ||
97 | o = getopt32(argc, argv, "du"); | 95 | o = getopt32(argc, argv, "du"); |
98 | 96 | ||
99 | /* Do the conversion requested by an argument else do the default | 97 | /* Do the conversion requested by an argument else do the default |
100 | * conversion depending on our name. */ | 98 | * conversion depending on our name. */ |
101 | if (o) | 99 | if (o) |
102 | ConvType = o; | 100 | conv_type = o; |
103 | 101 | ||
104 | do { | 102 | do { |
105 | /* might be convert(NULL) if there is no filename given */ | 103 | /* might be convert(NULL) if there is no filename given */ |
106 | o = convert(argv[optind], ConvType); | 104 | o = convert(argv[optind], conv_type); |
107 | if (o < 0) | 105 | if (o < 0) |
108 | break; | 106 | break; |
109 | optind++; | 107 | optind++; |
diff --git a/coreutils/id.c b/coreutils/id.c index 9dd5b48d3..27fb26e77 100644 --- a/coreutils/id.c +++ b/coreutils/id.c | |||
@@ -49,7 +49,7 @@ int id_main(int argc, char **argv) | |||
49 | #endif | 49 | #endif |
50 | /* Don't allow -n -r -nr -ug -rug -nug -rnug */ | 50 | /* Don't allow -n -r -nr -ug -rug -nug -rnug */ |
51 | /* Don't allow more than one username */ | 51 | /* Don't allow more than one username */ |
52 | opt_complementary = "?1:?:u--g:g--u:r?ug:n?ug" USE_SELINUX(":u--Z:Z--u:g--Z:Z--g"); | 52 | opt_complementary = "?1:u--g:g--u:r?ug:n?ug" USE_SELINUX(":u--Z:Z--u:g--Z:Z--g"); |
53 | flags = getopt32(argc, argv, "rnug" USE_SELINUX("Z")); | 53 | flags = getopt32(argc, argv, "rnug" USE_SELINUX("Z")); |
54 | 54 | ||
55 | /* This values could be overwritten later */ | 55 | /* This values could be overwritten later */ |
diff --git a/coreutils/install.c b/coreutils/install.c index 5503b55cd..8d71fa070 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -99,7 +99,7 @@ int install_main(int argc, char **argv) | |||
99 | #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS | 99 | #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS |
100 | applet_long_options = install_long_options; | 100 | applet_long_options = install_long_options; |
101 | #endif | 101 | #endif |
102 | opt_complementary = "?:s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); | 102 | opt_complementary = "s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); |
103 | /* -c exists for backwards compatibility, it's needed */ | 103 | /* -c exists for backwards compatibility, it's needed */ |
104 | 104 | ||
105 | flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), | 105 | flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), |
diff --git a/coreutils/sort.c b/coreutils/sort.c index f41bd6329..6371139cb 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c | |||
@@ -288,7 +288,7 @@ int sort_main(int argc, char **argv) | |||
288 | 288 | ||
289 | /* Parse command line options */ | 289 | /* Parse command line options */ |
290 | /* -o and -t can be given at most once */ | 290 | /* -o and -t can be given at most once */ |
291 | opt_complementary = "?:o--o:t--t:" /* -t, -o: maximum one of each */ | 291 | opt_complementary = "o--o:t--t:" /* -t, -o: maximum one of each */ |
292 | "k::"; /* -k takes list */ | 292 | "k::"; /* -k takes list */ |
293 | getopt32(argc, argv, OPT_STR, &str_ignored, &str_ignored, &str_o, &lst_k, &str_t); | 293 | getopt32(argc, argv, OPT_STR, &str_ignored, &str_ignored, &str_o, &lst_k, &str_t); |
294 | #if ENABLE_FEATURE_SORT_BIG | 294 | #if ENABLE_FEATURE_SORT_BIG |