Don't strdup an empty string
authorDan Fandrich <dan@coneharvesters.com>
Thu, 27 Sep 2007 18:39:10 +0000 (18:39 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 27 Sep 2007 18:39:10 +0000 (18:39 +0000)
lib/getenv.c

index 475c3d3..ca88234 100644 (file)
@@ -55,7 +55,7 @@ char *GetEnv(const char *variable)
   if (env && strcmp("HOME",variable) == 0)
     env = decc$translate_vms(env);
 #endif
-  return env?strdup(env):NULL;
+  return (env && env[0])?strdup(env):NULL;
 #endif
 #endif
 }