aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-17 12:36:39 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-17 12:36:39 +0200
commit048491fbdccc35edd481218baeedb31c5253aa12 (patch)
treec5a4ebb013068a300f8e3e907c88af3e0c98d208
parenta1799db4ac660a15285e1ac2464b5f622746d787 (diff)
downloadbusybox-w32-048491fbdccc35edd481218baeedb31c5253aa12.tar.gz
busybox-w32-048491fbdccc35edd481218baeedb31c5253aa12.tar.bz2
busybox-w32-048491fbdccc35edd481218baeedb31c5253aa12.zip
hush: trivial code shrink in builtin_getopts
function old new delta builtin_getopts 368 363 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 42f95ef6b..cdc3a8618 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -9897,12 +9897,13 @@ Test that VAR is a valid variable name?
9897 return EXIT_FAILURE; 9897 return EXIT_FAILURE;
9898 } 9898 }
9899 9899
9900 if (optstring[0] == ':') { 9900 c = 0;
9901 opterr = 0; 9901 if (optstring[0] != ':') {
9902 } else {
9903 cp = get_local_var_value("OPTERR"); 9902 cp = get_local_var_value("OPTERR");
9904 opterr = cp ? atoi(cp) : 1; 9903 /* 0 if "OPTERR=0", 1 otherwise */
9904 c = (!cp || NOT_LONE_CHAR(cp, '0'));
9905 } 9905 }
9906 opterr = c;
9906 cp = get_local_var_value("OPTIND"); 9907 cp = get_local_var_value("OPTIND");
9907 optind = cp ? atoi(cp) : 0; 9908 optind = cp ? atoi(cp) : 0;
9908 optarg = NULL; 9909 optarg = NULL;