From 0819c3a8cfe3e56bb6a4b38fcbeb15ae2c5cb92f Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 27 Sep 2007 18:39:10 +0000 Subject: [PATCH] Don't strdup an empty string --- lib/getenv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/getenv.c b/lib/getenv.c index 475c3d3..ca88234 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -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 } -- 2.7.4