From: Matthias Wachs Date: Mon, 16 Apr 2012 14:29:42 +0000 (+0000) Subject: - do not parse back files .conf~ but only files with extension .conf X-Git-Tag: initial-import-from-subversion-38251~13917 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58082a82b9b089de618dfe693e9342e078437451;p=oweals%2Fgnunet.git - do not parse back files .conf~ but only files with extension .conf --- diff --git a/src/util/configuration.c b/src/util/configuration.c index d006ed3ef..35ba15b4e 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -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; }