{
case SORT_DATE:
return browser_compare_date(a, b);
- break;
case SORT_SIZE:
return browser_compare_size(a, b);
- break;
case SORT_DESC:
return browser_compare_desc(a, b);
- break;
case SORT_COUNT:
return browser_compare_count(a, b);
- break;
case SORT_COUNT_NEW:
return browser_compare_count_new(a, b);
- break;
case SORT_SUBJECT:
default:
return browser_compare_subject(a, b);
- break;
}
}
* The goal is to highlight the good directory if LastDir is the parent dir
* of OldLastDir (this occurs mostly when one hit "../").
*/
- if (mutt_strncmp (LastDir, OldLastDir, mutt_strlen (LastDir)) == 0)
+ int ldlen = mutt_strlen (LastDir);
+ if ((ldlen > 0) && (mutt_strncmp (LastDir, OldLastDir, ldlen) == 0))
{
char TargetDir[_POSIX_PATH_MAX] = "";
#ifdef USE_IMAP
if (mutt_strcmp (state->entry[i].name, TargetDir) == 0)
{
menu->current = i;
+ break;
}
}
}
+ else
+ {
+ if ((mutt_strcmp (state->entry[0].desc, "..") == 0) ||
+ (mutt_strcmp (state->entry[0].desc, "../") == 0))
+ menu->current = 1;
+ }
snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
path, NONULL(Mask.pattern));
}
getcwd (LastDir, sizeof (LastDir));
else
{
- /* Should we use the tracking feature of the browser depends
+ /* Whether we use the tracking feature of the browser depends
* on which sort method we chose to use. This variable is defined
* only to help readability of the code.
*/
{
case SORT_DESC:
case SORT_SUBJECT:
+ case SORT_ORDER:
browser_track = 1;
break;
}
else
#endif
- /* Let's fill by default buf with the next mailbox containing
- * unread mails
- */
+ /* By default, fill buf with the next mailbox that contains unread
+ * mail */
mutt_buffy (buf, sizeof (buf));
if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
{
int n;
- /* If both pointers are on the same memory part
- * strfcpy is useless
- */
+ /* Make a copy of the mailbox name, but only if the pointers are different */
if (mbox != output)
strfcpy (output, mbox, olen);
n = mutt_strlen (output);
- /* Let's go backwards untill the next delimiter
+ /* Let's go backwards until the next delimiter
*
- * If output[n] is a '/', the first n-- will allow
+ * If output[n] is a '/', the first n-- will allow us
* to ignore it. If it isn't, then output looks like
* "/aaaaa/bbbb". There is at least one "b", so we can't skip
* the "/" after the 'a's.
*/
for (n--; n >= 0 && output[n] != delim ; n--);
- /* We stopped before the begining. There is a trailing
+ /* We stopped before the beginning. There is a trailing
* slash.
*/
if (n > 0)
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;
- }
}
FOREVER
strfcpy (output, path, olen);
int n = mutt_strlen (output);
- /* Remove everything untill the next slash */
+ /* Remove everything until the next slash */
for (n--; ((n >= 0) && (output[n] != '/')); n--);
if (n > 0)