From: Kevin McCarthy Date: Sat, 2 Feb 2019 23:03:03 +0000 (-0800) Subject: Separate out op variable in the browser. X-Git-Tag: mutt-1-12-rel~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a7639766010075ae73dcad80108ac1301f2f1d4;p=mutt Separate out op variable in the browser. The i variable is used in several places and scopes as a temporary index variable, but is also used to record the current operation. Separate them out to make the code less confusing. --- diff --git a/browser.c b/browser.c index e95dbdcb..daafce9f 100644 --- a/browser.c +++ b/browser.c @@ -652,7 +652,8 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num struct browser_state state; MUTTMENU *menu = NULL; struct stat st; - int i, killPrefix = 0; + int op, killPrefix = 0; + int i, j; int multiple = (flags & MUTT_SEL_MULTI) ? 1 : 0; int folder = (flags & MUTT_SEL_FOLDER) ? 1 : 0; int buffy = (flags & MUTT_SEL_BUFFY) ? 1 : 0; @@ -767,7 +768,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num FOREVER { - switch (i = mutt_menuLoop (menu)) + switch (op = mutt_menuLoop (menu)) { case OP_DESCEND_DIRECTORY: case OP_GENERIC_SELECT_ENTRY: @@ -801,7 +802,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num else mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf)); - if (i == OP_DESCEND_DIRECTORY || (mx_get_magic (buf) <= 0) + if (op == OP_DESCEND_DIRECTORY || (mx_get_magic (buf) <= 0) #ifdef USE_IMAP || state.entry[menu->current].inferiors #endif @@ -919,7 +920,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num if (multiple) { char **tfiles; - int i, j; if (menu->tagged) { @@ -1205,7 +1205,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num { int resort = 1; - int reverse = (i == OP_SORT_REVERSE); + int reverse = (op == OP_SORT_REVERSE); switch (mutt_multi_choice ((reverse) ? _("Reverse sort by (d)ate, (a)lpha, si(z)e, (c)ount, (u)nread, or do(n)'t sort? ") :