diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2006-04-20 20:05:52 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2006-04-20 20:05:52 +0000 |
commit | b585a9fad59f9d0c07681778b97d36b67bd9748d (patch) | |
tree | d809e30a40f38fd19b05d2cbd920187e84108432 /readline/histsearch.c | |
parent | 84041b4c47edb0461f3b82afb77ca2d81819ebfa (diff) | |
download | gdb-FSF.zip gdb-FSF.tar.gz gdb-FSF.tar.bz2 |
import of readlilne 5.1FSF
Diffstat (limited to 'readline/histsearch.c')
-rw-r--r-- | readline/histsearch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/readline/histsearch.c b/readline/histsearch.c index d94fd6c..1cc5875 100644 --- a/readline/histsearch.c +++ b/readline/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) |