projects
/
platform
/
upstream
/
curl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25bad58
)
Robert Weaver's fix
author
Daniel Stenberg
<daniel@haxx.se>
Wed, 24 Jan 2001 09:01:32 +0000
(09:01 +0000)
committer
Daniel Stenberg
<daniel@haxx.se>
Wed, 24 Jan 2001 09:01:32 +0000
(09:01 +0000)
lib/getenv.c
patch
|
blob
|
history
diff --git
a/lib/getenv.c
b/lib/getenv.c
index
0c23e76
..
941ee85
100644
(file)
--- a/
lib/getenv.c
+++ b/
lib/getenv.c
@@
-41,12
+41,13
@@
char *GetEnv(char *variable)
char env[MAX_PATH]; /* MAX_PATH is from windef.h */
char *temp = getenv(variable);
env[0] = '\0';
- ExpandEnvironmentStrings(temp, env, sizeof(env));
+ if (temp != NULL)
+ ExpandEnvironmentStrings(temp, env, sizeof(env));
#else
/* no length control */
char *env = getenv(variable);
#endif
- return
env
?strdup(env):NULL;
+ return
(env && env[0])
?strdup(env):NULL;
}
char *curl_getenv(char *v)