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>
This commit is contained in:
parent
b541d1fcbd
commit
200c1c46f4
13
shell/ash.c
13
shell/ash.c
@ -2286,7 +2286,7 @@ unsetvar(const char *s)
|
|||||||
free(vp);
|
free(vp);
|
||||||
INT_ON;
|
INT_ON;
|
||||||
} else {
|
} else {
|
||||||
setvar(s, 0, 0);
|
setvar2(s, 0);
|
||||||
vp->flags &= ~VEXPORT;
|
vp->flags &= ~VEXPORT;
|
||||||
}
|
}
|
||||||
ok:
|
ok:
|
||||||
@ -6339,7 +6339,7 @@ subevalvar(char *p, char *varname, int strloc, int subtype,
|
|||||||
|
|
||||||
switch (subtype) {
|
switch (subtype) {
|
||||||
case VSASSIGN:
|
case VSASSIGN:
|
||||||
setvar(varname, startp, 0);
|
setvar2(varname, startp);
|
||||||
amount = startp - expdest;
|
amount = startp - expdest;
|
||||||
STADJUST(amount, expdest);
|
STADJUST(amount, expdest);
|
||||||
return startp;
|
return startp;
|
||||||
@ -8554,7 +8554,7 @@ evalfor(union node *n, int flags)
|
|||||||
loopnest++;
|
loopnest++;
|
||||||
flags &= EV_TESTED;
|
flags &= EV_TESTED;
|
||||||
for (sp = arglist.list; sp; sp = sp->next) {
|
for (sp = arglist.list; sp; sp = sp->next) {
|
||||||
setvar(n->nfor.var, sp->text, 0);
|
setvar2(n->nfor.var, sp->text);
|
||||||
evaltree(n->nfor.body, flags);
|
evaltree(n->nfor.body, flags);
|
||||||
if (evalskip) {
|
if (evalskip) {
|
||||||
if (evalskip == SKIPCONT && --skipcount <= 0) {
|
if (evalskip == SKIPCONT && --skipcount <= 0) {
|
||||||
@ -9451,7 +9451,7 @@ evalcommand(union node *cmd, int flags)
|
|||||||
* '_' in 'vi' command mode during line editing...
|
* '_' in 'vi' command mode during line editing...
|
||||||
* However I implemented that within libedit itself.
|
* However I implemented that within libedit itself.
|
||||||
*/
|
*/
|
||||||
setvar("_", lastarg, 0);
|
setvar2("_", lastarg);
|
||||||
}
|
}
|
||||||
popstackmark(&smark);
|
popstackmark(&smark);
|
||||||
}
|
}
|
||||||
@ -12273,7 +12273,6 @@ dotcmd(int argc, char **argv)
|
|||||||
* bash returns exitcode 1 instead.
|
* bash returns exitcode 1 instead.
|
||||||
*/
|
*/
|
||||||
fullname = find_dot_file(argv[1]);
|
fullname = find_dot_file(argv[1]);
|
||||||
|
|
||||||
argv += 2;
|
argv += 2;
|
||||||
argc -= 2;
|
argc -= 2;
|
||||||
if (argc) { /* argc > 0, argv[0] != NULL */
|
if (argc) { /* argc > 0, argv[0] != NULL */
|
||||||
@ -13012,7 +13011,7 @@ init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setvar("PPID", utoa(getppid()), 0);
|
setvar2("PPID", utoa(getppid()));
|
||||||
|
|
||||||
p = lookupvar("PWD");
|
p = lookupvar("PWD");
|
||||||
if (p) {
|
if (p) {
|
||||||
@ -13267,7 +13266,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
hp = lookupvar("HOME");
|
hp = lookupvar("HOME");
|
||||||
if (hp) {
|
if (hp) {
|
||||||
hp = concat_path_file(hp, ".ash_history");
|
hp = concat_path_file(hp, ".ash_history");
|
||||||
setvar("HISTFILE", hp, 0);
|
setvar2("HISTFILE", hp);
|
||||||
free((char*)hp);
|
free((char*)hp);
|
||||||
hp = lookupvar("HISTFILE");
|
hp = lookupvar("HISTFILE");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user