summaryrefslogtreecommitdiff
path: root/lib/getenv.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-08-06 12:19:26 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-08-06 12:19:26 +0000
commit93bcfd4e65ba660e0bd45b7c25a0f8cb76c8368c (patch)
tree3be0daede0a7246b9bd5df9606c0de0734c58d08 /lib/getenv.c
parent1400561a5a52154ef0188865c059f874a65ee6f8 (diff)
downloadcurl-93bcfd4e65ba660e0bd45b7c25a0f8cb76c8368c.tar.gz
Nico Baggus' VMS adjustments
Diffstat (limited to 'lib/getenv.c')
-rw-r--r--lib/getenv.c12
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;
}