aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-22 05:10:33 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-22 05:10:33 +0100
commit8b8d32ea56d443c754f9230e2284ed65a2552df4 (patch)
tree59ecf04e33a71d5e4e87915609289f5588bacf32
parent6f99c91e431a5afb90ac6d041ea9b08d39c965eb (diff)
downloadbusybox-w32-8b8d32ea56d443c754f9230e2284ed65a2552df4.tar.gz
busybox-w32-8b8d32ea56d443c754f9230e2284ed65a2552df4.tar.bz2
busybox-w32-8b8d32ea56d443c754f9230e2284ed65a2552df4.zip
patch: accept and ignore -g NUM
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/patch.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/editors/patch.c b/editors/patch.c
index 69fa973a2..62477af16 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -80,8 +80,8 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
80 OPT_N = (1 << 3), 80 OPT_N = (1 << 3),
81 /*OPT_f = (1 << 4), ignored */ 81 /*OPT_f = (1 << 4), ignored */
82 /*OPT_E = (1 << 5), ignored, this is the default */ 82 /*OPT_E = (1 << 5), ignored, this is the default */
83 // /*OPT_g = (1 << x), ignored */ 83 /*OPT_g = (1 << 6), ignored */
84 OPT_dry_run = (1 << 6) * ENABLE_LONG_OPTS, 84 OPT_dry_run = (1 << 7) * ENABLE_LONG_OPTS,
85 }; 85 };
86 86
87 xfunc_error_retval = 2; 87 xfunc_error_retval = 2;
@@ -101,8 +101,9 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
101 /* "Controls actions when a file is under RCS or SCCS control, 101 /* "Controls actions when a file is under RCS or SCCS control,
102 * and does not exist or is read-only and matches the default version, 102 * and does not exist or is read-only and matches the default version,
103 * or when a file is under ClearCase control and does not exist..." 103 * or when a file is under ClearCase control and does not exist..."
104 * IOW: does anyone really wants this? */ 104 * IOW: rather obscure option.
105 // "get\0" Required_argument "g" /*ignored*/ 105 * But Gentoo's portage does use -g0 */
106 "get\0" Required_argument "g" /*ignored*/
106# endif 107# endif
107 "dry-run\0" No_argument "\xfd" 108 "dry-run\0" No_argument "\xfd"
108# if ENABLE_DESKTOP 109# if ENABLE_DESKTOP
@@ -112,8 +113,8 @@ int patch_main(int argc UNUSED_PARAM, char **argv)
112 ; 113 ;
113 applet_long_options = patch_longopts; 114 applet_long_options = patch_longopts;
114#endif 115#endif
115 /* -f,-E are ignored */ 116 /* -f,-E,-g are ignored */
116 opt = getopt32(argv, "p:i:RN""fE"/*"g:"*/, &p, &i /*,NULL*/); 117 opt = getopt32(argv, "p:i:RN""fEg:", &p, &i, NULL);
117 if (opt & OPT_R) 118 if (opt & OPT_R)
118 plus = '-'; 119 plus = '-';
119 patch_level = xatoi(p); /* can be negative! */ 120 patch_level = xatoi(p); /* can be negative! */