aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/diff.c10
-rw-r--r--editors/patch_bbox.c3
-rw-r--r--editors/sed.c8
3 files changed, 10 insertions, 11 deletions
diff --git a/editors/diff.c b/editors/diff.c
index 03c13908e..d90ac8f94 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -967,6 +967,11 @@ static const char diff_longopts[] ALIGN1 =
"starting-file\0" Required_argument "S"
"minimal\0" No_argument "d"
;
+# define GETOPT32 getopt32long
+# define LONGOPTS ,diff_longopts
+#else
+# define GETOPT32 getopt32
+# define LONGOPTS
#endif
int diff_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -980,10 +985,7 @@ int diff_main(int argc UNUSED_PARAM, char **argv)
/* exactly 2 params; collect multiple -L <label>; -U N */
opt_complementary = "=2";
-#if ENABLE_FEATURE_DIFF_LONG_OPTIONS
- applet_long_options = diff_longopts;
-#endif
- getopt32(argv, "abdiL:*NqrsS:tTU:+wupBE",
+ GETOPT32(argv, "abdiL:*NqrsS:tTU:+wupBE" LONGOPTS,
&L_arg, &s_start, &opt_U_context);
argv += optind;
while (L_arg)
diff --git a/editors/patch_bbox.c b/editors/patch_bbox.c
index aae7b7987..8e09ef488 100644
--- a/editors/patch_bbox.c
+++ b/editors/patch_bbox.c
@@ -111,10 +111,9 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
"no-backup-if-mismatch\0" No_argument "\xff" /*ignored*/
# endif
;
- applet_long_options = patch_longopts;
#endif
/* -f,-E,-g are ignored */
- opt = getopt32(argv, "p:i:RN""fEg:", &p, &i, NULL);
+ opt = getopt32long(argv, "p:i:RN""fEg:", patch_longopts, &p, &i, NULL);
if (opt & OPT_R)
plus = '-';
patch_level = xatoi(p); /* can be negative! */
diff --git a/editors/sed.c b/editors/sed.c
index 22580cf71..1a1098859 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -1508,16 +1508,14 @@ int sed_main(int argc UNUSED_PARAM, char **argv)
opt_e = opt_f = NULL;
opt_i = NULL;
opt_complementary = "nn"; /* count -n */
-
- IF_LONG_OPTS(applet_long_options = sed_longopts);
-
/* -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 = getopt32(argv, "i::rEne:*f:*", &opt_i, &opt_e, &opt_f,
- &G.be_quiet); /* counter for -n */
+ opt = getopt32long(argv, "i::rEne:*f:*", sed_longopts,
+ &opt_i, &opt_e, &opt_f,
+ &G.be_quiet); /* counter for -n */
//argc -= optind;
argv += optind;
if (opt & OPT_in_place) { // -i