aboutsummaryrefslogtreecommitdiff
path: root/coreutils/cut.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/cut.c')
-rw-r--r--coreutils/cut.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index d88a891b0..30dbc02db 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -12,14 +12,13 @@
12#include "busybox.h" 12#include "busybox.h"
13 13
14/* option vars */ 14/* option vars */
15static const char *const optstring = "b:c:f:d:sn"; 15static const char optstring[] = "b:c:f:d:sn";
16
17#define CUT_OPT_BYTE_FLGS (1<<0) 16#define CUT_OPT_BYTE_FLGS (1<<0)
18#define CUT_OPT_CHAR_FLGS (1<<1) 17#define CUT_OPT_CHAR_FLGS (1<<1)
19#define CUT_OPT_FIELDS_FLGS (1<<2) 18#define CUT_OPT_FIELDS_FLGS (1<<2)
20#define CUT_OPT_DELIM_FLGS (1<<3) 19#define CUT_OPT_DELIM_FLGS (1<<3)
21#define CUT_OPT_SUPPRESS_FLGS (1<<4) 20#define CUT_OPT_SUPPRESS_FLGS (1<<4)
22static unsigned long opt; 21static unsigned opt;
23 22
24static char delim = '\t'; /* delimiter, default is tab */ 23static char delim = '\t'; /* delimiter, default is tab */
25 24
@@ -179,9 +178,8 @@ int cut_main(int argc, char **argv)
179{ 178{
180 char *sopt, *ltok; 179 char *sopt, *ltok;
181 180
182 bb_opt_complementally = "b--bcf:c--bcf:f--bcf"; 181 opt_complementary = "b--bcf:c--bcf:f--bcf";
183 opt = 182 opt = getopt32(argc, argv, optstring, &sopt, &sopt, &sopt, &ltok);
184 bb_getopt_ulflags(argc, argv, optstring, &sopt, &sopt, &sopt, &ltok);
185 if (!(opt & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS))) 183 if (!(opt & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS)))
186 bb_error_msg_and_die 184 bb_error_msg_and_die
187 ("expected a list of bytes, characters, or fields"); 185 ("expected a list of bytes, characters, or fields");