- do not parse back files .conf~ but only files with extension .conf
authorMatthias Wachs <wachs@net.in.tum.de>
Mon, 16 Apr 2012 14:29:42 +0000 (14:29 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Mon, 16 Apr 2012 14:29:42 +0000 (14:29 +0000)
src/util/configuration.c

index d006ed3ef3e10ba24968a4c881d754140b11f345..35ba15b4e02675835cf454d1e5842ad780ffc669 100644 (file)
@@ -1228,8 +1228,17 @@ static int
 parse_configuration_file (void *cls, const char *filename)
 {
   struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+  char * ext;
   int ret;
 
+  /* Examine file extension */
+  ext = strrchr (filename, '.');
+  if ((NULL == ext) || (0 != strcmp (ext, ".conf")))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Skipping file `%s'\n", filename);
+    return GNUNET_OK;
+  }
+
   ret = GNUNET_CONFIGURATION_parse (cfg, filename);
   return ret;
 }