diff options
author | ache <ache@FreeBSD.org> | 2004-10-18 07:02:42 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2004-10-18 07:02:42 +0000 |
commit | 0a8076ac56fc245cdfb48a1ac83798a3d6086c30 (patch) | |
tree | f78c1227a8143a263e4974d6bf25cf0ccde0e716 /contrib/libreadline/histsearch.c | |
parent | 001407b3a64c7fac1489a2ad6eeb2d23254b3e19 (diff) | |
download | FreeBSD-src-0a8076ac56fc245cdfb48a1ac83798a3d6086c30.zip FreeBSD-src-0a8076ac56fc245cdfb48a1ac83798a3d6086c30.tar.gz |
Virgin import of GNU Readline 5.0
Diffstat (limited to 'contrib/libreadline/histsearch.c')
-rw-r--r-- | contrib/libreadline/histsearch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/libreadline/histsearch.c b/contrib/libreadline/histsearch.c index d94fd6c..1cc5875 100644 --- a/contrib/libreadline/histsearch.c +++ b/contrib/libreadline/histsearch.c @@ -77,11 +77,11 @@ history_search_internal (string, direction, anchored) if (string == 0 || *string == '\0') return (-1); - if (!history_length || ((i == history_length) && !reverse)) + if (!history_length || ((i >= history_length) && !reverse)) return (-1); - if (reverse && (i == history_length)) - i--; + if (reverse && (i >= history_length)) + i = history_length - 1; #define NEXT_LINE() do { if (reverse) i--; else i++; } while (0) |