From eb46fb7d331d1f8ffb4fa4f14c573db9bc2404fd Mon Sep 17 00:00:00 2001 From: Vincent Lefevre Date: Mon, 9 Sep 2002 20:04:36 +0000 Subject: [PATCH] Fixing history classes. --- history.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/history.c b/history.c index e9f4063b5..5130a7f03 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; -- 2.40.0