X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=7ff48e9fb62ef7ae5042c43288f42ca483c1a9dc;hp=6545888d35ae227a3f662f128bf4c73a8887ef48;hb=1ffe18af5bf2fda6f7dc86c514b56c6a82ec3040;hpb=9c29247938d64f721db448824a1121ef47ad2869 diff --git a/init.c b/init.c index 6545888..7ff48e9 100644 --- a/init.c +++ b/init.c @@ -2233,7 +2233,7 @@ char User_typed[LONG_STRING] = { 0 }; int Num_matched = 0; /* Number of matches for completion */ char Completed[STRING] = { 0 }; /* completed string (command or variable) */ -const char *Matches[MAX (NUMVARS, NUMCOMMANDS) + 1]; /* all the matches + User_typed */ +char *Matches[MAX (NUMVARS, NUMCOMMANDS) + 1]; /* all the matches + User_typed */ /* helper function for completion. Changes the dest buffer if necessary/possible to aid completion. @@ -2275,8 +2275,8 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1) { Num_matched = 0; m_strcpy(User_typed, sizeof(User_typed), pt); - p_clear(Matches, sizeof(Matches)); - p_clear(Completed, sizeof(Completed)); + p_clear(Matches, countof(Matches)); + p_clear(Completed, countof(Completed)); for (num = 0; Commands[num].name; num++) candidate (Completed, User_typed, Commands[num].name, sizeof(Completed)); @@ -2324,8 +2324,8 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1) { Num_matched = 0; m_strcpy(User_typed, sizeof(User_typed), pt); - p_clear(Matches, sizeof(Matches)); - p_clear(Completed, sizeof(Completed)); + p_clear(Matches, countof(Matches)); + p_clear(Completed, countof(Completed)); for (num = 0; MuttVars[num].option; num++) candidate(Completed, User_typed, MuttVars[num].option, sizeof(Completed)); @@ -2362,8 +2362,8 @@ int mutt_command_complete (char *buffer, size_t len, int pos, int numtabs) if (numtabs == 1) { Num_matched = 0; m_strcpy(User_typed, sizeof(User_typed), pt); - p_clear(Matches, sizeof(Matches)); - p_clear(Completed, sizeof(Completed)); + p_clear(Matches, countof(Matches)); + p_clear(Completed, countof(Completed)); for (num = 0; menu[num].name; num++) candidate (Completed, User_typed, menu[num].name, sizeof(Completed)); /* try the generic menu */