diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/cmp.c | 10 | ||||
-rw-r--r-- | editors/diff.c | 4 | ||||
-rw-r--r-- | editors/sed.c | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/editors/cmp.c b/editors/cmp.c index f53d9603c..ec86c0ce2 100644 --- a/editors/cmp.c +++ b/editors/cmp.c @@ -36,7 +36,7 @@ static const char fmt_differ[] ALIGN1 = "%s %s differ: char %"OFF_FMT"u, line %u // This fmt_l_opt uses gnu-isms. SUSv3 would be "%.0s%.0s%"OFF_FMT"u %o %o\n" static const char fmt_l_opt[] ALIGN1 = "%.0s%.0s%"OFF_FMT"u %3o %3o\n"; -static const char opt_chars[] ALIGN1 = "sl"; +#define OPT_STR "sl" #define CMP_OPT_s (1<<0) #define CMP_OPT_l (1<<1) @@ -52,11 +52,13 @@ int cmp_main(int argc UNUSED_PARAM, char **argv) unsigned opt; int retval = 0; - opt_complementary = "-1" + opt = getopt32(argv, "^" + OPT_STR + "\0" "-1" IF_DESKTOP(":?4") IF_NOT_DESKTOP(":?2") - ":l--s:s--l"; - opt = getopt32(argv, opt_chars); + ":l--s:s--l" + ); argv += optind; filename1 = *argv; diff --git a/editors/diff.c b/editors/diff.c index d90ac8f94..2f254575c 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -984,8 +984,8 @@ int diff_main(int argc UNUSED_PARAM, char **argv) INIT_G(); /* exactly 2 params; collect multiple -L <label>; -U N */ - opt_complementary = "=2"; - GETOPT32(argv, "abdiL:*NqrsS:tTU:+wupBE" LONGOPTS, + GETOPT32(argv, "^" "abdiL:*NqrsS:tTU:+wupBE" "\0" "=2" + LONGOPTS, &L_arg, &s_start, &opt_U_context); argv += optind; while (L_arg) diff --git a/editors/sed.c b/editors/sed.c index 1a1098859..f68f44724 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -1507,13 +1507,15 @@ int sed_main(int argc UNUSED_PARAM, char **argv) /* do normal option parsing */ opt_e = opt_f = NULL; opt_i = NULL; - opt_complementary = "nn"; /* count -n */ /* -i must be first, to match OPT_in_place definition */ /* -E is a synonym of -r: * GNU sed 4.2.1 mentions it in neither --help * nor manpage, but does recognize it. */ - opt = getopt32long(argv, "i::rEne:*f:*", sed_longopts, + opt = getopt32long(argv, "^" + "i::rEne:*f:*" + "\0" "nn"/*count -n*/, + sed_longopts, &opt_i, &opt_e, &opt_f, &G.be_quiet); /* counter for -n */ //argc -= optind; |