aboutsummaryrefslogtreecommitdiff
path: root/coreutils/cut.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/cut.c')
-rw-r--r--coreutils/cut.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 6578ce8ce..cdd90ab44 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -42,7 +42,7 @@
42 42
43 43
44/* option vars */ 44/* option vars */
45static const char optstring[] ALIGN1 = "b:c:f:d:sn"; 45#define OPT_STR "b:c:f:d:sn"
46#define CUT_OPT_BYTE_FLGS (1 << 0) 46#define CUT_OPT_BYTE_FLGS (1 << 0)
47#define CUT_OPT_CHAR_FLGS (1 << 1) 47#define CUT_OPT_CHAR_FLGS (1 << 1)
48#define CUT_OPT_FIELDS_FLGS (1 << 2) 48#define CUT_OPT_FIELDS_FLGS (1 << 2)
@@ -201,8 +201,11 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
201 char *sopt, *ltok; 201 char *sopt, *ltok;
202 unsigned opt; 202 unsigned opt;
203 203
204 opt_complementary = "b--bcf:c--bcf:f--bcf"; 204 opt = getopt32(argv, "^"
205 opt = getopt32(argv, optstring, &sopt, &sopt, &sopt, &ltok); 205 OPT_STR
206 "\0" "b--bcf:c--bcf:f--bcf",
207 &sopt, &sopt, &sopt, &ltok
208 );
206// argc -= optind; 209// argc -= optind;
207 argv += optind; 210 argv += optind;
208 if (!(opt & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS))) 211 if (!(opt & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS)))