* Found in: <20050309162127.GA5656@s>
http://lists.df7cb.de/mutt/message/20050309.162127.a244a894.en.html
* Found in: <20050309162127.GA5656@s>
http://lists.df7cb.de/mutt/message/20050309.162127.a244a894.en.html
-+ if (menu->is_mailbox_list && last_position >= 0)
-+ menu->current = last_position;
++ if ( menu->max && menu->is_mailbox_list ) {
++ if ( last_position > (menu->max-1) ) {
++ last_position = -1;
++ } else if (last_position >= 0) {
++ menu->current = last_position;
++ }
++ }
strfcpy (path, LastDir, sizeof (path));
mutt_pretty_mailbox (path, sizeof (path));
#ifdef USE_IMAP
strfcpy (path, LastDir, sizeof (path));
mutt_pretty_mailbox (path, sizeof (path));
#ifdef USE_IMAP
path, NONULL (Mask.pattern));
else
#endif
- snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
- path, NONULL(Mask.pattern));
path, NONULL (Mask.pattern));
else
#endif
- snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
- path, NONULL(Mask.pattern));
-+ {
-+ char *p = strrchr (OldLastDir, '/');
-+ if (p && p - OldLastDir == mutt_strlen (LastDir) &&
-+ mutt_strncmp (LastDir, OldLastDir, p - OldLastDir) == 0)
-+ {
-+ /* If we get here, it means that LastDir is the parent directory of
-+ * OldLastDir. I.e., we're returning from a subdirectory, and we want
-+ * to position the cursor on the directory we're returning from. */
-+ int i;
-+ for (i = 0; i < state->entrymax; i++)
-+ if (mutt_strcmp (state->entry[i].name, p + 1) == 0)
-+ menu->current = i;
-+ }
-+ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
-+ path, NONULL(Mask.pattern));
-+ }
-+
++ {
++ char *p = strrchr (OldLastDir, '/');
++ if (p && p - OldLastDir == mutt_strlen (LastDir) &&
++ mutt_strncmp (LastDir, OldLastDir, p - OldLastDir) == 0)
++ {
++ /* If we get here, it means that LastDir is the parent directory of
++ * OldLastDir. I.e., we're returning from a subdirectory, and we want
++ * to position the cursor on the directory we're returning from. */
++ int i;
++ for (i = 0; i < state->entrymax; i++)
++ if (mutt_strcmp (state->entry[i].name, p + 1) == 0)
++ menu->current = i;
++ }
++ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
++ path, NONULL(Mask.pattern));
++ }
int offset; /* which screen row to start the index */
int pagelen; /* number of entries per screen */
int tagprefix;
int offset; /* which screen row to start the index */
int pagelen; /* number of entries per screen */
int tagprefix;