aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-05-06 20:41:10 +0100
committerRon Yorston <rmy@pobox.com>2014-05-06 20:41:10 +0100
commitd3bef66324a8ca5eed9ad7c15ead3a1cc9a9151e (patch)
tree4b364ba4b6b9e96c2629fe382fef0248d76833dd /shell/ash.c
parent7905d97aeece18da362a5a1e066abff2d2e5c16b (diff)
parentd257608a8429b64e1a04c7cb6d99975eeb2c3955 (diff)
downloadbusybox-w32-d3bef66324a8ca5eed9ad7c15ead3a1cc9a9151e.tar.gz
busybox-w32-d3bef66324a8ca5eed9ad7c15ead3a1cc9a9151e.tar.bz2
busybox-w32-d3bef66324a8ca5eed9ad7c15ead3a1cc9a9151e.zip
Merge branch 'busybox' into merge
Conflicts: debianutils/which.c editors/vi.c libbb/executable.c
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 19565d185..ce6e355eb 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -55,6 +55,7 @@
55#include <setjmp.h> 55#include <setjmp.h>
56#include <fnmatch.h> 56#include <fnmatch.h>
57#include <sys/times.h> 57#include <sys/times.h>
58#include <sys/utsname.h> /* for setting $HOSTNAME */
58 59
59#include "busybox.h" /* for applet_names */ 60#include "busybox.h" /* for applet_names */
60#include "unicode.h" 61#include "unicode.h"
@@ -9353,6 +9354,9 @@ mklocal(char *name)
9353 vp->flags |= VSTRFIXED|VTEXTFIXED; 9354 vp->flags |= VSTRFIXED|VTEXTFIXED;
9354 if (eq) 9355 if (eq)
9355 setvareq(name, 0); 9356 setvareq(name, 0);
9357 else
9358 /* "local VAR" unsets VAR: */
9359 setvar(name, NULL, 0);
9356 } 9360 }
9357 } 9361 }
9358 lvp->vp = vp; 9362 lvp->vp = vp;
@@ -12899,7 +12903,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
12899 e = errno; 12903 e = errno;
12900 goto loop; 12904 goto loop;
12901 } 12905 }
12902 if (!execable_file(fullname)) { 12906 if (!file_is_executable(fullname)) {
12903 e = ENOEXEC; 12907 e = ENOEXEC;
12904 goto loop; 12908 goto loop;
12905 } 12909 }
@@ -13522,6 +13526,11 @@ init(void)
13522#if ENABLE_ASH_BASH_COMPAT 13526#if ENABLE_ASH_BASH_COMPAT
13523 p = lookupvar("SHLVL"); 13527 p = lookupvar("SHLVL");
13524 setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT); 13528 setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
13529 if (!lookupvar("HOSTNAME")) {
13530 struct utsname uts;
13531 uname(&uts);
13532 setvar2("HOSTNAME", uts.nodename);
13533 }
13525#endif 13534#endif
13526 p = lookupvar("PWD"); 13535 p = lookupvar("PWD");
13527 if (p) { 13536 if (p) {