gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24660 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r24660 - gnunet/src/util
Date: Thu, 1 Nov 2012 17:42:56 +0100

Author: LRN
Date: 2012-11-01 17:42:56 +0100 (Thu, 01 Nov 2012)
New Revision: 24660

Modified:
   gnunet/src/util/configuration.c
Log:
Debug for dollar-expansion

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2012-11-01 16:31:38 UTC (rev 24659)
+++ gnunet/src/util/configuration.c     2012-11-01 16:42:56 UTC (rev 24660)
@@ -983,8 +983,13 @@
   const char *post;
   const char *env;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Asked to $-expand %s\n", orig);
+
   if (orig[0] != '$')
+  {
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Doesn't start with $ - not expanding\n");
     return orig;
+  }
   i = 0;
   while ((orig[i] != '/') && (orig[i] != '\\') && (orig[i] != '\0'))
     i++;
@@ -997,16 +1002,21 @@
     orig[i] = '\0';
     post = &orig[i + 1];
   }
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Split into `%s' and `%s'\n", orig, post);
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_filename (cfg, "PATHS", &orig[1], 
&prefix))
   {
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Filename for `%s' is not in PATHS config 
section\n", &orig[1]);
     if (NULL == (env = getenv (&orig[1])))
     {
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "`%s' is not an environment variable\n", 
&orig[1]);
       orig[i] = DIR_SEPARATOR;
+      LOG (GNUNET_ERROR_TYPE_DEBUG, "Expanded to `%s' (returning orig)\n", 
orig);
       return orig;
     }
     prefix = GNUNET_strdup (env);
   }
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Prefix is `%s'\n", prefix);
   result = GNUNET_malloc (strlen (prefix) + strlen (post) + 2);
   strcpy (result, prefix);
   if ((strlen (prefix) == 0) ||
@@ -1015,6 +1025,7 @@
   strcat (result, post);
   GNUNET_free (prefix);
   GNUNET_free (orig);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Expanded to `%s'\n", result);
   return result;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]