From: Kevin McCarthy Date: Fri, 18 Nov 2016 01:54:35 +0000 (-0800) Subject: Revert changes made to mutt_find_cfg() in 3c6d322912e3 X-Git-Tag: mutt-1-8-rel~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81970a04e89e09d1cad6ddea882435757383f223;p=mutt Revert changes made to mutt_find_cfg() in 3c6d322912e3 The usage of MUTT_VERSION in mutt_find_cfg() was fine before the commit: it wasn't using MUTT_VERSION inlined into a string with format string substitution. Revert to the version of mutt_find_cfg() before that changeset. --- diff --git a/init.c b/init.c index 7d620815..09999c89 100644 --- a/init.c +++ b/init.c @@ -2901,11 +2901,11 @@ static void mutt_srandom (void) static char* mutt_find_cfg (const char *home, const char *xdg_cfg_home) { - const char* names[][2] = + const char* names[] = { - { "muttrc", "-" MUTT_VERSION }, - { "muttrc", "" }, - { NULL, NULL }, + "muttrc-" MUTT_VERSION, + "muttrc", + NULL, }; const char* locations[][2] = @@ -2925,12 +2925,12 @@ static char* mutt_find_cfg (const char *home, const char *xdg_cfg_home) if (!locations[i][0]) continue; - for (j = 0; names[j][0]; j++) + for (j = 0; names[j]; j++) { char buffer[STRING]; - snprintf (buffer, sizeof (buffer), "%s/%s%s%s", - locations[i][0], locations[i][1], names[j][0], names[j][1]); + snprintf (buffer, sizeof (buffer), + "%s/%s%s", locations[i][0], locations[i][1], names[j]); if (access (buffer, F_OK) == 0) return safe_strdup(buffer); }