From 6fb29176d8c099607100c1261328c9ea68a744db Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Nov 2011 18:36:38 +0000 Subject: [PATCH] treat empty string as NULL --- src/util/common_logging.c | 3 ++- src/util/test_common_logging_runtime_loglevels.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/common_logging.c b/src/util/common_logging.c index d564530cc..101f2fd9f 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -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) diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 5c069dc9f..79b888c56 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -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 -- 2.25.1