diff options
author | Ron Yorston <rmy@pobox.com> | 2014-01-02 10:25:11 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-01-02 10:25:11 +0000 |
commit | b8f278ee745778806118f57fb7884d205eba05ad (patch) | |
tree | fef237f6dd302c59918cf389a60c120e58d3e086 /shell | |
parent | 3fd34651ea72ea1c335d3170f234cb0517fd897f (diff) | |
parent | 57434022cefde87133b8ad39fb3b79c1274e7684 (diff) | |
download | busybox-w32-b8f278ee745778806118f57fb7884d205eba05ad.tar.gz busybox-w32-b8f278ee745778806118f57fb7884d205eba05ad.tar.bz2 busybox-w32-b8f278ee745778806118f57fb7884d205eba05ad.zip |
Merge branch 'busybox' into merge
Conflicts:
archival/Config.src
shell/ash.c
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 18 | ||||
-rw-r--r-- | shell/hush.c | 4 |
2 files changed, 12 insertions, 10 deletions
diff --git a/shell/ash.c b/shell/ash.c index 6e6fc6a71..97c9589cc 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2348,7 +2348,7 @@ unsetvar(const char *s) | |||
2348 | free(vp); | 2348 | free(vp); |
2349 | INT_ON; | 2349 | INT_ON; |
2350 | } else { | 2350 | } else { |
2351 | setvar(s, 0, 0); | 2351 | setvar2(s, 0); |
2352 | vp->flags &= ~VEXPORT; | 2352 | vp->flags &= ~VEXPORT; |
2353 | } | 2353 | } |
2354 | ok: | 2354 | ok: |
@@ -6698,7 +6698,7 @@ subevalvar(char *p, char *varname, int strloc, int subtype, | |||
6698 | 6698 | ||
6699 | switch (subtype) { | 6699 | switch (subtype) { |
6700 | case VSASSIGN: | 6700 | case VSASSIGN: |
6701 | setvar(varname, startp, 0); | 6701 | setvar2(varname, startp); |
6702 | amount = startp - expdest; | 6702 | amount = startp - expdest; |
6703 | STADJUST(amount, expdest); | 6703 | STADJUST(amount, expdest); |
6704 | return startp; | 6704 | return startp; |
@@ -8960,7 +8960,7 @@ evalfor(union node *n, int flags) | |||
8960 | loopnest++; | 8960 | loopnest++; |
8961 | flags &= EV_TESTED; | 8961 | flags &= EV_TESTED; |
8962 | for (sp = arglist.list; sp; sp = sp->next) { | 8962 | for (sp = arglist.list; sp; sp = sp->next) { |
8963 | setvar(n->nfor.var, sp->text, 0); | 8963 | setvar2(n->nfor.var, sp->text); |
8964 | evaltree(n->nfor.body, flags); | 8964 | evaltree(n->nfor.body, flags); |
8965 | if (evalskip) { | 8965 | if (evalskip) { |
8966 | if (evalskip == SKIPCONT && --skipcount <= 0) { | 8966 | if (evalskip == SKIPCONT && --skipcount <= 0) { |
@@ -9955,7 +9955,7 @@ evalcommand(union node *cmd, int flags) | |||
9955 | * '_' in 'vi' command mode during line editing... | 9955 | * '_' in 'vi' command mode during line editing... |
9956 | * However I implemented that within libedit itself. | 9956 | * However I implemented that within libedit itself. |
9957 | */ | 9957 | */ |
9958 | setvar("_", lastarg, 0); | 9958 | setvar2("_", lastarg); |
9959 | } | 9959 | } |
9960 | popstackmark(&smark); | 9960 | popstackmark(&smark); |
9961 | } | 9961 | } |
@@ -12777,7 +12777,6 @@ dotcmd(int argc, char **argv) | |||
12777 | * bash returns exitcode 1 instead. | 12777 | * bash returns exitcode 1 instead. |
12778 | */ | 12778 | */ |
12779 | fullname = find_dot_file(argv[1]); | 12779 | fullname = find_dot_file(argv[1]); |
12780 | |||
12781 | argv += 2; | 12780 | argv += 2; |
12782 | argc -= 2; | 12781 | argc -= 2; |
12783 | if (argc) { /* argc > 0, argv[0] != NULL */ | 12782 | if (argc) { /* argc > 0, argv[0] != NULL */ |
@@ -13615,8 +13614,11 @@ init(void) | |||
13615 | } | 13614 | } |
13616 | 13615 | ||
13617 | if (!ENABLE_PLATFORM_MINGW32) | 13616 | if (!ENABLE_PLATFORM_MINGW32) |
13618 | setvar("PPID", utoa(getppid()), 0); | 13617 | setvar2("PPID", utoa(getppid())); |
13619 | 13618 | #if ENABLE_ASH_BASH_COMPAT | |
13619 | p = lookupvar("SHLVL"); | ||
13620 | setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1)); | ||
13621 | #endif | ||
13620 | p = lookupvar("PWD"); | 13622 | p = lookupvar("PWD"); |
13621 | if (p) { | 13623 | if (p) { |
13622 | if (*p != '/' || stat(p, &st1) || stat(".", &st2) | 13624 | if (*p != '/' || stat(p, &st1) || stat(".", &st2) |
@@ -13909,7 +13911,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13909 | hp = lookupvar("HOME"); | 13911 | hp = lookupvar("HOME"); |
13910 | if (hp) { | 13912 | if (hp) { |
13911 | hp = concat_path_file(hp, ".ash_history"); | 13913 | hp = concat_path_file(hp, ".ash_history"); |
13912 | setvar("HISTFILE", hp, 0); | 13914 | setvar2("HISTFILE", hp); |
13913 | free((char*)hp); | 13915 | free((char*)hp); |
13914 | hp = lookupvar("HISTFILE"); | 13916 | hp = lookupvar("HISTFILE"); |
13915 | } | 13917 | } |
diff --git a/shell/hush.c b/shell/hush.c index 912ecf15f..927193450 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1310,7 +1310,7 @@ static void restore_G_args(save_arg_t *sv, char **argv) | |||
1310 | * backgrounds (i.e. stops) or kills all members of currently running | 1310 | * backgrounds (i.e. stops) or kills all members of currently running |
1311 | * pipe. | 1311 | * pipe. |
1312 | * | 1312 | * |
1313 | * Wait builtin in interruptible by signals for which user trap is set | 1313 | * Wait builtin is interruptible by signals for which user trap is set |
1314 | * or by SIGINT in interactive shell. | 1314 | * or by SIGINT in interactive shell. |
1315 | * | 1315 | * |
1316 | * Trap handlers will execute even within trap handlers. (right?) | 1316 | * Trap handlers will execute even within trap handlers. (right?) |
@@ -1398,7 +1398,7 @@ static void restore_G_args(save_arg_t *sv, char **argv) | |||
1398 | * for them - a bit like emulating kernel pending signal mask in userspace. | 1398 | * for them - a bit like emulating kernel pending signal mask in userspace. |
1399 | * We are interested in: signals which need to have special handling | 1399 | * We are interested in: signals which need to have special handling |
1400 | * as described above, and all signals which have traps set. | 1400 | * as described above, and all signals which have traps set. |
1401 | * Signals are rocorded in pending_set. | 1401 | * Signals are recorded in pending_set. |
1402 | * After each pipe execution, we extract any pending signals | 1402 | * After each pipe execution, we extract any pending signals |
1403 | * and act on them. | 1403 | * and act on them. |
1404 | * | 1404 | * |