treat empty string as NULL
authorChristian Grothoff <christian@grothoff.org>
Sat, 5 Nov 2011 18:36:38 +0000 (18:36 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 5 Nov 2011 18:36:38 +0000 (18:36 +0000)
src/util/common_logging.c
src/util/test_common_logging_runtime_loglevels.c

index d564530ccf7bd9b7dd5240275805efd70794167d..101f2fd9febc6277324077501dba0521d71e939e 100644 (file)
@@ -546,7 +546,8 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile)
   component_nopid = GNUNET_strdup (comp);
 
   env_logfile = getenv ("GNUNET_FORCE_LOGFILE");
-  if (env_logfile != NULL)
+  if ( (env_logfile != NULL) &&
+       (strlen (env_logfile) > 0) )
     logfile = env_logfile;
 
   if (logfile == NULL)
index 5c069dc9f13d2a825292e87a7b0dfc73890aeeca..79b888c560424d114c4bf5f9bb0c7639c66cf0ae 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2008 Christian Grothoff (and other contributing authors)
+     (C) 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published