summaryrefslogtreecommitdiffstats
path: root/history.c
diff options
context:
space:
mode:
authorVincent Lefevre <vincent@vinc17.net>2002-09-09 20:04:36 +0000
committerVincent Lefevre <vincent@vinc17.net>2002-09-09 20:04:36 +0000
commit07ea5a0bc8f88492093c9f441276d973117dc6cd (patch)
treeb2353d73b2cbb9ef8d6a1bb226bf0fbd6c9a8ab3 /history.c
parentdf79f971c5a38d865a9aeaff831f9aaf4cf9c883 (diff)
Fixing history classes.
Diffstat (limited to 'history.c')
-rw-r--r--history.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/history.c b/history.c
index e9f4063b..5130a7f0 100644
--- a/history.c
+++ b/history.c
@@ -96,10 +96,9 @@ char *mutt_history_next (history_class_t hclass)
return (""); /* disabled */
next = h->cur + 1;
- if (next > h->last - 1)
+ if (next > HistSize - 1)
next = 0;
- if (h->hist[next])
- h->cur = next;
+ h->cur = h->hist[next] ? next : 0;
return (h->hist[h->cur] ? h->hist[h->cur] : "");
}
@@ -114,13 +113,9 @@ char *mutt_history_prev (history_class_t hclass)
prev = h->cur - 1;
if (prev < 0)
{
- prev = h->last - 1;
- if (prev < 0)
- {
- prev = HistSize - 1;
- while (prev > 0 && h->hist[prev] == NULL)
- prev--;
- }
+ prev = HistSize - 1;
+ while (prev > 0 && h->hist[prev] == NULL)
+ prev--;
}
if (h->hist[prev])
h->cur = prev;