From f8e39b2d614ea3e853ff0454e60b55f9f5c522c2 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 9 Feb 2012 10:10:56 +0000 Subject: Create fake HOME environment variable --- shell/ash.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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) } } +#if ENABLE_PLATFORM_MINGW32 + p = lookupvar("HOME"); + if (!p) { + const char *hd, *hp; + + hd = lookupvar("HOMEDRIVE"); + hp = lookupvar("HOMEPATH"); + if (hd && hp) { + char *s; + + if ((s=malloc(strlen(hd) + strlen(hp) + 1)) != NULL) { + strcat(strcpy(s, hd), hp); + setvar("HOME", s, VEXPORT); + free(s); + } + } + } +#endif + if (!ENABLE_PLATFORM_MINGW32) setvar("PPID", utoa(getppid()), 0); -- cgit v1.2.3-55-g6feb