diff options
author | Ron Yorston <rmy@pobox.com> | 2012-02-09 10:10:56 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-02-09 11:53:08 +0000 |
commit | f8e39b2d614ea3e853ff0454e60b55f9f5c522c2 (patch) | |
tree | 617c925233177162f081c1bd6a2355571c0ded28 | |
parent | 6e29c121e0afdcfceb1418c2faa6ed070a358f71 (diff) | |
download | busybox-w32-f8e39b2d614ea3e853ff0454e60b55f9f5c522c2.tar.gz busybox-w32-f8e39b2d614ea3e853ff0454e60b55f9f5c522c2.tar.bz2 busybox-w32-f8e39b2d614ea3e853ff0454e60b55f9f5c522c2.zip |
Create fake HOME environment variable
-rw-r--r-- | shell/ash.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index bc7e005ab..de1116656 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -13429,6 +13429,25 @@ init(void) | |||
13429 | } | 13429 | } |
13430 | } | 13430 | } |
13431 | 13431 | ||
13432 | #if ENABLE_PLATFORM_MINGW32 | ||
13433 | p = lookupvar("HOME"); | ||
13434 | if (!p) { | ||
13435 | const char *hd, *hp; | ||
13436 | |||
13437 | hd = lookupvar("HOMEDRIVE"); | ||
13438 | hp = lookupvar("HOMEPATH"); | ||
13439 | if (hd && hp) { | ||
13440 | char *s; | ||
13441 | |||
13442 | if ((s=malloc(strlen(hd) + strlen(hp) + 1)) != NULL) { | ||
13443 | strcat(strcpy(s, hd), hp); | ||
13444 | setvar("HOME", s, VEXPORT); | ||
13445 | free(s); | ||
13446 | } | ||
13447 | } | ||
13448 | } | ||
13449 | #endif | ||
13450 | |||
13432 | if (!ENABLE_PLATFORM_MINGW32) | 13451 | if (!ENABLE_PLATFORM_MINGW32) |
13433 | setvar("PPID", utoa(getppid()), 0); | 13452 | setvar("PPID", utoa(getppid()), 0); |
13434 | 13453 | ||