aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-11-08 14:12:13 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2013-11-08 14:12:13 +0100
commit200c1c46f4aa2cb70e0e3581a5bd8aa72a1aac0f (patch)
treece3c03c060c1f052147a7c493e78d0983f1bdfdc /shell
parentb541d1fcbd39f9fa8768a57e48a334b1929303e5 (diff)
downloadbusybox-w32-200c1c46f4aa2cb70e0e3581a5bd8aa72a1aac0f.tar.gz
busybox-w32-200c1c46f4aa2cb70e0e3581a5bd8aa72a1aac0f.tar.bz2
busybox-w32-200c1c46f4aa2cb70e0e3581a5bd8aa72a1aac0f.zip
ash: Use setvar2 some more
(add/remove: 0/0 grow/shrink: 10/15 up/down: 13/-27) Total: -14 bytes Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c
index d696bbdac..f9b4d3fe6 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2286,7 +2286,7 @@ unsetvar(const char *s)
2286 free(vp); 2286 free(vp);
2287 INT_ON; 2287 INT_ON;
2288 } else { 2288 } else {
2289 setvar(s, 0, 0); 2289 setvar2(s, 0);
2290 vp->flags &= ~VEXPORT; 2290 vp->flags &= ~VEXPORT;
2291 } 2291 }
2292 ok: 2292 ok:
@@ -6339,7 +6339,7 @@ subevalvar(char *p, char *varname, int strloc, int subtype,
6339 6339
6340 switch (subtype) { 6340 switch (subtype) {
6341 case VSASSIGN: 6341 case VSASSIGN:
6342 setvar(varname, startp, 0); 6342 setvar2(varname, startp);
6343 amount = startp - expdest; 6343 amount = startp - expdest;
6344 STADJUST(amount, expdest); 6344 STADJUST(amount, expdest);
6345 return startp; 6345 return startp;
@@ -8554,7 +8554,7 @@ evalfor(union node *n, int flags)
8554 loopnest++; 8554 loopnest++;
8555 flags &= EV_TESTED; 8555 flags &= EV_TESTED;
8556 for (sp = arglist.list; sp; sp = sp->next) { 8556 for (sp = arglist.list; sp; sp = sp->next) {
8557 setvar(n->nfor.var, sp->text, 0); 8557 setvar2(n->nfor.var, sp->text);
8558 evaltree(n->nfor.body, flags); 8558 evaltree(n->nfor.body, flags);
8559 if (evalskip) { 8559 if (evalskip) {
8560 if (evalskip == SKIPCONT && --skipcount <= 0) { 8560 if (evalskip == SKIPCONT && --skipcount <= 0) {
@@ -9451,7 +9451,7 @@ evalcommand(union node *cmd, int flags)
9451 * '_' in 'vi' command mode during line editing... 9451 * '_' in 'vi' command mode during line editing...
9452 * However I implemented that within libedit itself. 9452 * However I implemented that within libedit itself.
9453 */ 9453 */
9454 setvar("_", lastarg, 0); 9454 setvar2("_", lastarg);
9455 } 9455 }
9456 popstackmark(&smark); 9456 popstackmark(&smark);
9457} 9457}
@@ -12273,7 +12273,6 @@ dotcmd(int argc, char **argv)
12273 * bash returns exitcode 1 instead. 12273 * bash returns exitcode 1 instead.
12274 */ 12274 */
12275 fullname = find_dot_file(argv[1]); 12275 fullname = find_dot_file(argv[1]);
12276
12277 argv += 2; 12276 argv += 2;
12278 argc -= 2; 12277 argc -= 2;
12279 if (argc) { /* argc > 0, argv[0] != NULL */ 12278 if (argc) { /* argc > 0, argv[0] != NULL */
@@ -13012,7 +13011,7 @@ init(void)
13012 } 13011 }
13013 } 13012 }
13014 13013
13015 setvar("PPID", utoa(getppid()), 0); 13014 setvar2("PPID", utoa(getppid()));
13016 13015
13017 p = lookupvar("PWD"); 13016 p = lookupvar("PWD");
13018 if (p) { 13017 if (p) {
@@ -13267,7 +13266,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
13267 hp = lookupvar("HOME"); 13266 hp = lookupvar("HOME");
13268 if (hp) { 13267 if (hp) {
13269 hp = concat_path_file(hp, ".ash_history"); 13268 hp = concat_path_file(hp, ".ash_history");
13270 setvar("HISTFILE", hp, 0); 13269 setvar2("HISTFILE", hp);
13271 free((char*)hp); 13270 free((char*)hp);
13272 hp = lookupvar("HISTFILE"); 13271 hp = lookupvar("HISTFILE");
13273 } 13272 }