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 =
967 "starting-file\0" Required_argument "S" 967 "starting-file\0" Required_argument "S"
968 "minimal\0" No_argument "d" 968 "minimal\0" No_argument "d"
969 ; 969 ;
970# define GETOPT32 getopt32long
971# define LONGOPTS ,diff_longopts
972#else
973# define GETOPT32 getopt32
974# define LONGOPTS
970#endif 975#endif
971 976
972int diff_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 977int diff_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -980,10 +985,7 @@ int diff_main(int argc UNUSED_PARAM, char **argv)
980 985
981 /* exactly 2 params; collect multiple -L <label>; -U N */ 986 /* exactly 2 params; collect multiple -L <label>; -U N */
982 opt_complementary = "=2"; 987 opt_complementary = "=2";
983#if ENABLE_FEATURE_DIFF_LONG_OPTIONS 988 GETOPT32(argv, "abdiL:*NqrsS:tTU:+wupBE" LONGOPTS,
984 applet_long_options = diff_longopts;
985#endif
986 getopt32(argv, "abdiL:*NqrsS:tTU:+wupBE",
987 &L_arg, &s_start, &opt_U_context); 989 &L_arg, &s_start, &opt_U_context);
988 argv += optind; 990 argv += optind;
989 while (L_arg) 991 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)
111 "no-backup-if-mismatch\0" No_argument "\xff" /*ignored*/ 111 "no-backup-if-mismatch\0" No_argument "\xff" /*ignored*/
112# endif 112# endif
113 ; 113 ;
114 applet_long_options = patch_longopts;
115#endif 114#endif
116 /* -f,-E,-g are ignored */ 115 /* -f,-E,-g are ignored */
117 opt = getopt32(argv, "p:i:RN""fEg:", &p, &i, NULL); 116 opt = getopt32long(argv, "p:i:RN""fEg:", patch_longopts, &p, &i, NULL);
118 if (opt & OPT_R) 117 if (opt & OPT_R)
119 plus = '-'; 118 plus = '-';
120 patch_level = xatoi(p); /* can be negative! */ 119 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)
1508 opt_e = opt_f = NULL; 1508 opt_e = opt_f = NULL;
1509 opt_i = NULL; 1509 opt_i = NULL;
1510 opt_complementary = "nn"; /* count -n */ 1510 opt_complementary = "nn"; /* count -n */
1511
1512 IF_LONG_OPTS(applet_long_options = sed_longopts);
1513
1514 /* -i must be first, to match OPT_in_place definition */ 1511 /* -i must be first, to match OPT_in_place definition */
1515 /* -E is a synonym of -r: 1512 /* -E is a synonym of -r:
1516 * GNU sed 4.2.1 mentions it in neither --help 1513 * GNU sed 4.2.1 mentions it in neither --help
1517 * nor manpage, but does recognize it. 1514 * nor manpage, but does recognize it.
1518 */ 1515 */
1519 opt = getopt32(argv, "i::rEne:*f:*", &opt_i, &opt_e, &opt_f, 1516 opt = getopt32long(argv, "i::rEne:*f:*", sed_longopts,
1520 &G.be_quiet); /* counter for -n */ 1517 &opt_i, &opt_e, &opt_f,
1518 &G.be_quiet); /* counter for -n */
1521 //argc -= optind; 1519 //argc -= optind;
1522 argv += optind; 1520 argv += optind;
1523 if (opt & OPT_in_place) { // -i 1521 if (opt & OPT_in_place) { // -i