projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1799db
)
hush: trivial code shrink in builtin_getopts
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 17 Aug 2017 10:36:39 +0000
(12:36 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 17 Aug 2017 10:36:39 +0000
(12:36 +0200)
function old new delta
builtin_getopts 368 363 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c
patch
|
blob
|
history
diff --git
a/shell/hush.c
b/shell/hush.c
index 42f95ef6bb1de0f3db6ffb3ece7a7ed3adea75c9..cdc3a861841637fd116d934c93a56d675dce5457 100644
(file)
--- a/
shell/hush.c
+++ b/
shell/hush.c
@@
-9897,12
+9897,13
@@
Test that VAR is a valid variable name?
return EXIT_FAILURE;
}
- if (optstring[0] == ':') {
- opterr = 0;
- } else {
+ c = 0;
+ if (optstring[0] != ':') {
cp = get_local_var_value("OPTERR");
- opterr = cp ? atoi(cp) : 1;
+ /* 0 if "OPTERR=0", 1 otherwise */
+ c = (!cp || NOT_LONE_CHAR(cp, '0'));
}
+ opterr = c;
cp = get_local_var_value("OPTIND");
optind = cp ? atoi(cp) : 0;
optarg = NULL;