diff options
author | ache <ache@FreeBSD.org> | 2003-08-31 17:55:46 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2003-08-31 17:55:46 +0000 |
commit | ab304301db89e3906744fb6a81655b9598764582 (patch) | |
tree | f75abef44b0f70973592b7edb66a319f92a1d7b2 /contrib/libreadline/history.c | |
parent | e5103242d94d5211fa44bad651caaa7a61519867 (diff) | |
download | FreeBSD-src-ab304301db89e3906744fb6a81655b9598764582.zip FreeBSD-src-ab304301db89e3906744fb6a81655b9598764582.tar.gz |
Virgin import of GNU Readline 4.3
Diffstat (limited to 'contrib/libreadline/history.c')
-rw-r--r-- | contrib/libreadline/history.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/contrib/libreadline/history.c b/contrib/libreadline/history.c index d59d8ce..4242f33 100644 --- a/contrib/libreadline/history.c +++ b/contrib/libreadline/history.c @@ -44,12 +44,6 @@ # include <unistd.h> #endif -#if defined (HAVE_STRING_H) -# include <string.h> -#else -# include <strings.h> -#endif /* !HAVE_STRING_H */ - #include "history.h" #include "histlib.h" @@ -71,6 +65,9 @@ static HIST_ENTRY **the_history = (HIST_ENTRY **)NULL; history that we save. */ static int history_stifled; +/* The current number of slots allocated to the input_history. */ +static int history_size; + /* If HISTORY_STIFLED is non-zero, then this is the maximum number of entries to remember. */ int history_max_entries; @@ -83,9 +80,6 @@ int history_offset; /* The number of strings currently stored in the history list. */ int history_length; -/* The current number of slots allocated to the input_history. */ -static int history_size; - /* The logical `base' of the history array. It defaults to 1. */ int history_base = 1; @@ -349,19 +343,19 @@ stifle_history (max) max_input_history = history_max_entries = max; } -/* Stop stifling the history. This returns the previous amount the - history was stifled by. The value is positive if the history was - stifled, negative if it wasn't. */ +/* Stop stifling the history. This returns the previous maximum + number of history entries. The value is positive if the history + was stifled, negative if it wasn't. */ int unstifle_history () { if (history_stifled) { history_stifled = 0; - return (-history_max_entries); + return (history_max_entries); } - - return (history_max_entries); + else + return (-history_max_entries); } int |