+2015-04-21 Benno Schulenberg <bensberg@justemail.net>
+ * src/browser.c (findnextfile): Save the settings of the global
+ case-sens, direction, and regexp flags, and restore them on exit.
+ And do this not in do_filesearch() but in findnextfile(), so that
+ it will also work for do_fileresearch().
+
2015-04-20 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (need_horizontal_update, need_vertical_update): Fuse
two identical functions into one: need_screen_update().
const char *filetail = tail(filelist[looking_at]);
/* The filename we display, minus the path. */
const char *rev_start = filetail, *found = NULL;
+ unsigned stash[sizeof(flags) / sizeof(flags[0])];
+ /* A storage place for the current flag settings. */
+
+ /* Save the settings of all flags. */
+ memcpy(stash, flags, sizeof(flags));
+
+ /* Search forward, case insensitive and without regexes. */
+ UNSET(BACKWARDS_SEARCH);
+ UNSET(CASE_SENSITIVE);
+ UNSET(USE_REGEXP);
/* Step through each filename in the list until a match is found or
* we've come back to the point where we started. */
rev_start = filetail;
}
+ /* Restore the settings of all flags. */
+ memcpy(flags, stash, sizeof(flags));
+
/* Select the one we've found. */
selected = looking_at;
}
/* Search for a filename. */
void do_filesearch(void)
{
- UNSET(CASE_SENSITIVE);
- UNSET(USE_REGEXP);
- UNSET(BACKWARDS_SEARCH);
-
if (filesearch_init() != 0) {
/* Cancelled, or a blank search string, or done something. */
bottombars(MBROWSER);