1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Robert Weaver's fix

This commit is contained in:
Daniel Stenberg 2001-01-24 09:01:32 +00:00
parent 25bad589ba
commit b3dbdfa306

View File

@ -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)