From 6b5cb35eb62b9aea27659b5750a155bd8cf74ee0 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Thu, 17 Nov 2016 17:54:35 -0800 Subject: [PATCH] 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. --- init.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init.c b/init.c index 31de34249..ee271538c 100644 --- a/init.c +++ b/init.c @@ -3220,11 +3220,11 @@ static int mutt_execute_commands (LIST *p) 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] = @@ -3244,12 +3244,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); } -- 2.40.0