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 @@
/* option vars */
-static const char optstring[] ALIGN1 = "b:c:f:d:sn";
+#define OPT_STR "b:c:f:d:sn"
#define CUT_OPT_BYTE_FLGS (1 << 0)
#define CUT_OPT_CHAR_FLGS (1 << 1)
#define CUT_OPT_FIELDS_FLGS (1 << 2)
@@ -201,8 +201,11 @@ int cut_main(int argc UNUSED_PARAM, char **argv)
char *sopt, *ltok;
unsigned opt;
- opt_complementary = "b--bcf:c--bcf:f--bcf";
- opt = getopt32(argv, optstring, &sopt, &sopt, &sopt, &ltok);
+ opt = getopt32(argv, "^"
+ OPT_STR
+ "\0" "b--bcf:c--bcf:f--bcf",
+ &sopt, &sopt, &sopt, &ltok
+ );
// argc -= optind;
argv += optind;
if (!(opt & (CUT_OPT_BYTE_FLGS | CUT_OPT_CHAR_FLGS | CUT_OPT_FIELDS_FLGS)))