diff options
Diffstat (limited to 'lib/getenv.c')
-rw-r--r-- | lib/getenv.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/getenv.c b/lib/getenv.c index 941ee8535..1a34f57f7 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -29,6 +29,10 @@ #include <windows.h> #endif +#ifdef VMS +#include <unixlib.h> +#endif + #ifdef MALLOCDEBUG #include "memdebug.h" #endif @@ -44,9 +48,17 @@ char *GetEnv(char *variable) if (temp != NULL) ExpandEnvironmentStrings(temp, env, sizeof(env)); #else +#ifdef VMS + char *env = getenv(variable); + if (env && strcmp("HOME",variable) == 0) { + env = decc$translate_vms(env); + } +/* printf ("Getenv: %s=%s\n",variable,env); */ +#else /* no length control */ char *env = getenv(variable); #endif +#endif return (env && env[0])?strdup(env):NULL; } |