Home | History | Annotate | Download | only in libedit
History log of /src/lib/libedit/readline.c
RevisionDateAuthorComments
 1.183  14-Jun-2025  christos Change kill(0, signo) -> raise(signo) so that we only signal the current
process not the whole process group. Pointed out by geoff thomas. Related
issues:
https://www.postgresql.org/message-id/271520.1713052173%40sss.pgh.pa.us
https://github.com/astral-sh/python-build-standalone/pull/652\
#issuecomment-2972762033
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=159226
 1.182  26-Mar-2024  christos fix insert key (Xose Vazquez Perez)
 1.181  25-Apr-2023  christos pass lint.
 1.180  24-Apr-2023  christos PR/57376: Jorge Giner: readline file completion does not quote; do the same.
 1.179  21-Apr-2023  christos Align types with readline-8.2 (wiz@)
 1.178  02-Dec-2022  christos PR/57095: Yilei Yang: Change readline's replace_history_entry to not make a copy
of the string to replace since H_REPLACE already makes a copy (fixes memory leak)
 1.177  30-Oct-2022  christos improvements in malloc/free handling.
 1.176  21-Sep-2022  christos PR/57016: Ricky Zhou: declare lastidx
 1.175  20-Sep-2022  christos PR/57016: Ricky Zhou: Revert to trimming the last newline instead of the
first one so that multi-line commands work again.
 1.174  08-Apr-2022  christos PR/56778: Detlev Casanova: Missing rl_initialize call in rl_copy_text
 1.173  19-Feb-2022  christos PR/56695: Walter Lozano: Correct declaration of hook functions.
 1.172  08-Feb-2022  christos PR/56693: Walter Lozano: Add support for rl_delete_text and rl_set_key
 1.171  31-Jan-2022  christos PR/56622: Walter Lozano: Improve readline compatibility by adding
rl_readline_state support.
 1.170  29-Jan-2022  christos Add more refreshes from Walter Lozano. The readline example in
http://www.mcld.co.uk/blog/2009/simple-gnu-readline-callback-style-example.html
still does not work, but it is better.
 1.169  11-Jan-2022  christos PR/56618: Walter Lozano: Improve libedit compatibility with readline by
implementing:

rl_copy_text, rl_erase_empty_line, rl_message, rl_on_new_line,
rl_replace_line, rl_restore_prompt, rl_save_prompt
 1.168  10-Sep-2021  rillig libedit: fix indentation

No change to the resulting object files.
 1.167  10-Sep-2021  christos rl_startup_hook should be called each time. From Carlos Henrique Lima Melara
 1.166  09-Sep-2021  christos fix memory issues found by fuzzing (double frees and buffer overflows)
 1.165  03-Sep-2021  christos Try to refactor this in order to correct some of the memory issues
reported by Christian Holler.
 1.164  21-Aug-2021  christos PR/56370: mirabilos: libedit change from 2017 kills history in gdb
 1.163  21-Aug-2021  christos Add more api to make gdb-11 happy (but not gdbtui as usual)
 1.162  15-Aug-2021  rillig libedit: simplify calls to macro ADD_STRING

The lint comments CONSTCOND and LINTED were not necessary. It is
simpler to just specify what to free. GCC optimizes free(NULL) to be a
no-op.

No functional change.
 1.161  15-Aug-2021  rillig readline: fix lint warning about effective unconst cast

Calling strchr to avoid the syntactical unconst cast is not necessary
here. A simple pointer assignment is enough.

No functional change.
 1.160  15-Aug-2021  christos Add a LINTED comment... Why doesn't NOTREACHED work?
 1.159  09-Oct-2019  christos add +1 to strlcpy's (Patrick Welche)
 1.158  08-Oct-2019  christos Change strncpy to either memcpy (when we know the len), or strlcpy (when
we used to NUL terminate explicitly.
 1.157  21-Aug-2019  christos Increment offset when adding an element to history to keep it aligned with
the last element entered (Sandy Li Changqing)
 1.156  23-Jul-2019  christos PR/54399: S�ren Tempel: Uninitialized memory access in libedit history.
Initialize the buffer using calloc. While here change all malloc(a * sizeof(b))
to calloc(a, sizeof(b)). XXX: should fix realloc similarly.
 1.155  07-Jun-2019  christos PR/54281: Jonathan Perkins: NUL terminate rl_line_buffer on modification
to avoid completion leak.
 1.154  07-Jun-2019  christos PR/54280: rl_completer_quote_characters should be const for readline compat
 1.153  07-Jun-2019  christos PR/54279: Jonathan Perkins: Ignore adjacent start/end prompt ignore.
 1.152  26-Apr-2019  christos Follow the man page for EL_GETTC and not require a NULL terminated argument
list: https://reviews.llvm.org/D61191
 1.151  15-Feb-2019  christos PR/53983: Jonathan Perkins: Fix types for readline compatibility
 1.150  14-Feb-2019  christos PR/53981: Jonathan Perkins: history_list should null-terminate
 1.149  10-Jan-2019  christos PR/53856: F. Aragon: editline/libedit not prompting colors in readline mode
 1.148  02-Dec-2018  christos Add a couple more readline compat functions.
 1.147  09-Jun-2018  christos branches: 1.147.2;
Provide more compatibility with readline headers; now python-3.6.5 works
when changing 'readline' -> 'edit' in setup.py.
Revert previous conditional setting of unbuffered.
 1.146  01-Jan-2018  christos branches: 1.146.2;
Only FLUSH if we are ending libedit; DRAIN if we suspend for readline.
This allows pasting multiline buffers (Gerry Swislow)
 1.145  08-Dec-2017  christos For applications that don't issue their own prompt (like python)
don't set unbuffered unless they've already printed the prompt.
This avoids printing the prompt before the application has a chance
to process the input line.
From sjg@
 1.144  17-Sep-2017  kre PR lib/52547 - read_history (readline.c) should now sets history_length.

Patch from Yen Chi Hsuan in the PR, extracted from Apple's version of
readline.c, then modified by me to be consistent about what the return
value really is.
 1.143  05-Sep-2017  christos For readline emulation, don't reset the tty to "sane" (cooked) mode if we
did not start this way. Also set and reset the tty on entry and exit from
readline() since this is what readline does.
 1.142  01-Sep-2017  christos PR/51517: Jay West: Tty settings not restored on exit
PR/51518: Jay West: prompt is interleaved with client output

Both these issues are caused by rl_restore_handler not DTRT; fix
it so that it kills the internal libedit state completely. This is
inefficient, but it works.

Also fix:
1. add append_history()/H_NSAVE_FP
2. call the rl_startup_hook before printing the first prompt as documented.
callint it from rl_initialize breaks python, because the callback ends
up being invoked before the readline module is installed, and we end up
dereferencing a NULL pointer.
3. add el_resize_terminal.

With those changes, s/lreadline/ledit/g in python works.
 1.141  21-Apr-2017  abhinav When doing filename autocompletion, append a trailing slash at the end of directory
names. We already do this when there is only one completion option but
in case of of multiple completion options, it wasn't being done.

ok christos@
 1.140  09-Jan-2017  christos branches: 1.140.2;
Make sure we take into account history_base when computing negative history
offsets. (Gerry Swinslow)
 1.139  28-Oct-2016  christos pass the stream to the getc function
 1.138  01-Sep-2016  mbalmer fix typo
 1.137  24-Aug-2016  christos more compatible with readline history functions.
 1.136  02-Jun-2016  christos branches: 1.136.2;
Fix previous to better match readline behavior (Ingo Schwarze)
 1.135  02-Jun-2016  christos From Ingo Schwarze:

In libedit, the only way how H_ENTER can fail is memory exhaustion,
too, and of course it is handled gracefully, returning -1 from
history(). So of course, we will continue to handle it gracefully
in add_history() as well, but we are free to decide what to do with
the library state in this case because GNU just dies...

I think the most reasonable course of action is to simply not change
the library state in any way when add_history() fails due to memory
exhaustion, but just return.

If H_ENTER does not fail, we know that the history now contains at
least one entry, so there is no need any longer to check the H_GETSIZE
return value. And we can of course always set current_history_valid.

While testing these changes, i noticed three problems so closely
related that i'd like to fix them in the same diff.

1. libedit has the wrong prototype for add_history().
GNU readline-6.3 defines it as void add_history(const char *).
Of course, that is very stupid - no way to report problems to
the caller! But the whole point of a compatibility mode is
being compatible, so we should ultimately change this.
Of course, changing the prototype of a public symbol requires
a libedit major bump. I don't want to do that casually.
Rather, i will take a note and change the prototype the next
time we need a libedit major bump for more important reasons.
For now, let's just always return 0.

2. While *implicitely* pushing an old entry off the history
increments history_base in GNU readline, testing reveals that
*explicitly* deleting one does not. Again, this is not
documented, but it applies to both remove_history() and
stifle_history(). So delete history_base manipulation
from stifle_history(), which also allows to simplify the
code and delete two automatic variables.

3. GNU readline add_history(NULL) crashes with a segfault.
There is nothing wrong with having a public interface
behave that way. Many standard interfaces do, including
strlen(3). Such crashes can even be useful to catch
buggy application programs.
In libedit/readline.c rev. 1.104, Christos made add_history()
silently ignore this coding error, according to the commit
message to hide a bug in nslookup(1). That change was never
merged to OpenBSD. I strongly disagree with this change.
If nslookup(1) is still broken, that program needs to be
fixed instead. In any case, delete the bogus check; hiding
bugs is dangerous.
 1.134  31-May-2016  christos remove the right history entry (Ingo Schwarze)
 1.133  13-May-2016  christos From Bastian Maerkisch, via Igno Schwarze:

Even though section "2.3.3 Information About the History List"
of the history(3) info(1) manual only says

-- Function: int where_history (void)
Returns the offset of the current history element.

which maybe isn't completely clear, a plausible implementation
is that the offset returned is the same offset that can be used
for history_set_pos(), i.e. that it is 0 for the oldest entry
and increases with time, and that's how the GNU implementation
behaves indeed.

The libedit implementation, on the other hand, returns 1 for the
newest entry and increases going back in time.
 1.132  09-May-2016  christos GNU readline(3) regards history chronologically, that is, from the
perspective of the dawn of time, so "next" means "newer" and "previous"
means "older". Libedit, by contrast, uses reverse chronology and
regards history from the perspective of the present, such that "next"
means "longer ago" and "previous" means "not so long ago".

The following patch fixes previous_history() and next_history()
as proposed by Bastian Maerkisch.

But there is a related problem demonstrated by Bastian's regression
tests that his patch did not fix: next_history() can advance not
only to the newest entry, but beyond it, which core libedit cannot
do. So that feature must be implemented locally in readline.c.

With that, the last of Bastians tests is fixed, test_movement_direction().

This patch also improves libedit documentation to more clearly state
what "previous" and "next" mean. GNU readline documentation is
just as unclear, but we can't easily fix that since libedit doesn't
include its own readline.3 manual.

(Ingo Schwarze)
 1.131  09-May-2016  christos The libedit implementation of history_get() also differs from the GNU
implementation: libedit goes to the entry with the given number
stored in the HistEvent structure, while GNU subtracts history_base,
then advances that many entries from the oldest one. If entries were
removed in between, GNU advances further than libedit.

The call sequence H_CURR, H_DELDATA, H_CURR, H_NEXT_EVDATA looks
weird, as if part of that must somehow be redundant. But actually,
the user interface is so counter-intuitive that every single step
is really required.

- The first H_CURR is needed to be able to go back after an error.
- The H_DELDATA is needed to move the cursor. Even though it takes
a pointer to ev, that structure is not filled in when the call
succeeds. H_DELDATA only moves the cursor, it doesn't tell us
the new event number.
- Consequently, the second H_CURR is required to get ev.num filled
in. But it doesn't return the data because ev has no field for
that.
- So even though the cursor is already positioned correctly,
H_NEXT_EVDATA is needed as the final step merely to get the data.

(Ingo Schwarze)
 1.130  08-May-2016  christos In stiffle_history(), trim excessive entries from the history and advance
history_base like the GNU implementation does. (from Bastian Maerkisch)
 1.129  06-May-2016  christos fix logic (Ingo Schwarze)
 1.128  18-Apr-2016  christos From Ingo Schwarze:
* Replace fcns.c by a shorter and simpler func.h
and include it only in the one file needing it, map.c.
* Combine help.h and help.c into a simplified help.h
and include it only in the one file needing it, map.c.
* Check the very simple, static files editline.c, historyn.c, and
tokenizern.c into CVS rather than needlessly generating them.
* So we no longer autogenerate any C files. :-)
* Shorten and simplify makelist by deleting the options -n, -e, -bc,
and -m; the latter was unused and useless in the first place.
* Move the declaration of el_func_t from fcns.h to the header
actually needing it, map.h. Since that header is already
included by el.h for unrelated reasons, that makes el_func_t
just as globally available as before.
* No longer include the simplified fcns.h into el.h,
include it directly into the *.c files needing it.
 1.127  23-Mar-2016  christos Start removing the WIDECHAR ifdefs; building without it has stopped working
anyway. (Ingo Schwarze)
 1.126  24-Feb-2016  christos Make the read_char function always take a wchar_t * argument (Ingo Schwarze)
 1.125  17-Feb-2016  christos whitespace and header sorting changes (Ingo Schwarze). No functional changes.
 1.124  16-Feb-2016  christos more include file cleanup (Ingo Schwarze)
 1.123  16-Feb-2016  christos From Ingo Scharze:
Let "el.h" include everything needed for struct editline,
and don't include that stuff multiple times. That also improves
consistency, also avoids circular inclusions, and also makes it
easier to follow what is going on, even though not quite as nice.
But it seems like the best we can do...
 1.122  16-Feb-2016  christos cleanup chartype.h includes (Ingo Schwarze)
 1.121  16-Feb-2016  christos cleanup inclusion of histedit.h (Ingo Schwarze)
 1.120  15-Feb-2016  christos attribute unused
 1.119  15-Feb-2016  christos OpenBSD readline.c rev. 1.14 2015/02/06 23:21:58 millert
use SIZE_MAX
 1.118  15-Feb-2016  christos OpenBSD readline.c rev. 1.13 2015/01/13 08:33:12 reyk
rl_set_keyboard_input_timeout() for readline 4.2 compat
 1.117  02-Jun-2015  christos Adjust API to a more modern readline (Ryo Onodera)
 1.116  26-May-2015  christos - fix types of rl_completion_entry_function and rl_add_defun
- call update pos before completion to refresh the screen
From Thomas Eriksson
 1.115  01-Apr-2015  christos Fix overlapping strcpy (Gerry Swislow)
 1.114  24-Mar-2015  christos set some readline compatibility default key settings.
https://bugzilla.redhat.com/attachment.cgi?id=1001895
 1.113  18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.112  15-Aug-2014  christos Fix typo in comment (Tobias Stoeckmann)
 1.111  06-Jul-2014  christos branches: 1.111.2;
PR/48957: Federico G. Schwindt: Restore commented out code that broke
rl_callback_handler.
 1.110  21-Jan-2014  christos branches: 1.110.2;
... if called prior to using_history(). This needed to be worked around
in PHP: http://git.php.net/?p=php-src.git;a=commitdiff;h=31d67bd3

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1055409
 1.109  28-Aug-2013  christos get rid of PATH_MAX.
 1.108  28-May-2013  christos expose rl_catch_signals and explain what we are doing.
 1.107  13-Jan-2013  christos explicitly pass (void *)0 instead of NULL.
 1.106  12-Oct-2012  christos Add trailing NULL's to the varargs functions as required. (John Spencer)
 1.105  12-Jul-2012  christos branches: 1.105.2;
PR/46678: Ian Wienand: Add stub implementation for rl_free_line_state()
 1.104  05-Jun-2012  christos don't crash if add_history is called from an empty line. Called from
nslookup in new bind.
XXX: pullup to 6
 1.103  15-May-2012  christos define the new variable
 1.102  15-May-2012  christos Add rl_completion_word_break_hook from:
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/\
5ec6a45fa762b8cbd0305ca06acb8780335a486a
 1.101  21-Mar-2012  matt Use C89 functions definitions.
Remove use of __P
 1.100  18-Nov-2011  christos branches: 1.100.2;
Add missing *
 1.99  16-Aug-2011  christos branches: 1.99.2;
re-enable -Wconversion
 1.98  29-Jul-2011  christos pass -Wconversion
 1.97  29-Jul-2011  christos - fix unused params
- unconditionalize vis.h
 1.96  29-Jul-2011  christos KNF return (\1); -> return \1;
 1.95  28-Jul-2011  christos kill ptr_t and ioctl_t, add * sizeof(*foo) to all allocations.
 1.94  28-Jul-2011  christos handle systems without getpwent_r
 1.93  28-Jul-2011  christos use vis.h from .
 1.92  16-Sep-2010  christos unbreak readline history.
 1.91  28-Aug-2010  christos setup a callback to be invoked on resize buffers so that readline can
reset rl_line_buffer which unfortunately some applications use it directly.
 1.90  04-Aug-2010  christos provide rl_on_newline
 1.89  15-Apr-2010  christos From Jess Thrysoee
- Fix wint_t to Int confusion
 1.88  03-Jan-2010  christos rename historyw -> history_w for consistency.
add wide tst code and make it the default.
 1.87  30-Dec-2009  christos Fix wide build, test it, but don't turn it on yet.
 1.86  30-Dec-2009  christos Wide character support (UTF-8) from Johny Mattsson; currently disabled.
 1.85  07-Sep-2009  christos apply apple patches from:
http://opensource.apple.com/source/libedit/libedit-11/patches/
 1.84  22-Jul-2009  christos Fix memory leaks in error paths.
From Michael Cook mcook at bbn dot com
 1.83  08-Apr-2009  christos Fix off by one error reported by: Caleb Welton cwelton at greenplum dot com
 1.82  31-Mar-2009  christos implement RL_PROMPT_{START,END}_IGNORE
 1.81  21-Feb-2009  christos more size_t stuff.
 1.80  15-Feb-2009  christos pass lint on _LP64.
 1.79  12-Feb-2009  sketch More fixes for existing portability stuff.
 1.78  05-Feb-2009  christos branches: 1.78.2;
add rl_set_prompt
 1.77  18-Jan-2009  lukem fix -Wsign-compare issues
 1.76  11-Jan-2009  christos - insert a space after the recognized string if it was an exact match
- initialize properly the string used for completion.
From Alex Bligh alex at alex dot org dot uk
- Make char constants consistent
 1.75  29-Apr-2008  martin Convert to new 2 clause license
 1.74  05-Apr-2008  christos branches: 1.74.2;
add EL_REFRESH for the benefit of readline
 1.73  04-Apr-2008  christos Add rl_forced_update_display() from Gerry Swislow
 1.72  12-Aug-2007  christos patches from Axel Thimm
 1.71  27-May-2007  christos Add rl_completion_matches, fix remove_history
 1.70  24-Nov-2006  christos - Add more readline functions, enough for gdb-6.5
- Make el_get varyadic, and implement EL_GETTC.
- XXX: the EL_SETTC api will change in the future.
 1.69  21-Aug-2006  christos Change to a 3 clause copyright after permission of the holders.
 1.68  23-Jul-2006  christos PR/34062: Tanaka Akira: rl_deprep_term_function is NULL in libedit.
Default to rl_deprep_terminal as suggested; do the same for
rl_prep_term_function
 1.67  25-Mar-2006  rtr remove if/free block checking known condition

coverity 2762 / run 11
 1.66  21-Mar-2006  christos Coverity CID 2743: Not really a memory leak, but make it obvious that we
always free tmp.
 1.65  18-Mar-2006  christos Lint comment.
 1.64  18-Mar-2006  christos Coverity CID 1666: Plug memory leak.
 1.63  18-Mar-2006  christos Coverity CID 1667: Plug memory leak
 1.62  18-Mar-2006  christos Coverity CID 1662: Memory leak.
 1.61  06-Mar-2006  christos use the tty chars for reprint and eof instead of hard-coded ^R and ^D
 1.60  13-Feb-2006  christos PR/32817: Magnus Svensson: write_history and read_history returncode is not
readline compatible.
 1.59  12-Feb-2006  christos Partial rl_getc_function support from Jess Thrysoee.
 1.58  14-Jul-2005  christos PR/30747: David N. Williams: libedit is missing remove_history()
Added, please test.
 1.57  11-Jun-2005  christos PR/30500: Paul Shupak: Inconsistent definition of tilde_expand().
Provide a layer of indirection between the readline compatibility functions
and our internal implementation, so that we have the freedom to change the
function signature.
 1.56  10-Jun-2005  christos Bug reported from Martin Dietze:

The place to change the completion_append_character is
usually somewhere in the `rl_completion_entry_function'
callback which is where one usually can distinguish between
file- or dir-like entries to append a slash for dirs etc.

This does no longer work since `fn_complete()' takes the
`append_character' as argument before the callback is executed,
so that changes to the variable `rl_completion_append_character'
have in fact no effect for the current completion.

Fix by adding a function that returns the rl_completion_append_character,
when it gets passed in a filename in readline emulation.
 1.55  27-May-2005  agc Use the correct type for the stored callback function
 1.54  27-May-2005  agc Sync the alternative readline interface with reality:

+ the rl_callback_handler_install takes a pointer to a void function
which has one char * argument (it's called that way in the readline
emulation source, otherwise there's no way to pass the line buffer
to the function which processes the line when EOL is encountered)

+ provide a prototype for that function signature and use it

Makes the callback readline interface work now.
 1.53  07-May-2005  dsl Separate out the filename completion functions from the readline() code.
Pass in loads of parameters instead of relying on shed-loads of global
variables to modify the behaviour.
The filename completion code can now be enabled by code that uses el_gets().
(eg /bin/sh)
 1.52  19-Apr-2005  christos check for pwd != NULL, fix a missed getpwnam.
 1.51  12-Apr-2005  christos PR/29958: Peter Bex: add rl_variable_bind and rl_attempted_completion_over
 1.50  02-Apr-2005  christos use getpwent_r
 1.49  10-Mar-2005  christos branches: 1.49.2;
Always update the position variables before the map function is called.
From Rob Rodgers, thanks!
 1.48  09-Mar-2005  christos set UNBUFFERED again after you do the line callback so that the new line
gets refreshed.
 1.47  08-Sep-2004  christos cut out the middle-man and use el_insertstr() directly.
 1.46  27-Feb-2004  christos Better fix for rl_prep_terminal() from Gerry Swislow.
 1.45  17-Jan-2004  christos portability fixes.
 1.44  05-Dec-2003  lukem Tokenization function enhancements:
* Make tok_init(), tok_end(), tok_reset(), tok_line() and tok_str()
publically available in <histedit.h>
* Documented the public functions in editline(3)
* Renamed tok_line() -> tok_str()
* Added new tok_line() which takes a "const LineInfo *" instead of
"const char *" (the former has "cursor" information), and optionally
return the argv index ("int *cursorc") and offset within that index
("int *cursorv"). This means that completion routines can use the
tokenization code to crack the line and easily find which word the
cursor is at. (mmm, context sensitive completion :)
* Fixed TEST/test.c when using "continuation" lines (unmatched quote
or \ at EOL), and added some more DEBUG messages including highlighting
where the cursor is (with a `_').
 1.43  03-Nov-2003  christos Fix uninitialized variable.
 1.42  02-Nov-2003  christos From: Gerry Swislow gerry at certif dot com

1) File name completion should list the files in the current directory
if no text is entered. The previous version wouldn't list anything if
the text to complete was empty.

2) When listing directories, the entries "." and ".." shouldn't be
shown.

3) The filename completion should be used if the user's
rl_attempted_completion_function doesn't return any matches. The
previous version didn't do that.
 1.41  01-Nov-2003  christos initialize ptr.
 1.40  27-Oct-2003  christos Make readline csh-like history work.
From Gerry Swislow <gerry at certif dot com>.
 1.39  19-Oct-2003  christos add rl_catch_signals
 1.38  16-Oct-2003  christos More libedit readline emulation functions from: Gerry Swislow
<gerry at certif dot com>
 1.37  15-Oct-2003  christos don't limit ^c to alpha c, and add VIS_NOSLASH so that vis(3) does not
produce \^c
 1.36  09-Oct-2003  christos PR/23107: Nathan Williams: ^D as the first char on the command line does
not DTRT in readline compatibility mode
 1.35  26-Sep-2003  christos Implement enough of readline's 4.0 async mode to make gdb happy. This is
not complete yet, but it seems to work...
This required to introduce an unbuffered mode to el_gets(), but that was
a minor change.
 1.34  14-Sep-2003  christos Match the stupid function pointer declarations with actual readline's 4.0.
This is gross.
 1.33  14-Sep-2003  christos make this compile.
 1.32  14-Sep-2003  christos - provide enough hooks to compile gdb-5.3
- fix el_get(e, EL_TERMINAL, (char **))
 1.31  19-Jun-2003  christos From michael@moria.de:
Fix realloc case where we could be running out of space if too many matches.
 1.30  19-Jun-2003  christos From michael@moria.de:
- use __attribute__((__unused__)) in arguments where appropriate.
- some int -> size_t and char * to const char * conversions.
 1.29  29-Mar-2003  wiz Consistently spell occurrence with two rs.
 1.28  10-Mar-2003  christos null is not 0
 1.27  10-Mar-2003  christos include alloca.h for systems that need it.
 1.26  21-Jan-2003  christos fix directory descriptor leak [from michael at moria dot de]
 1.25  27-Oct-2002  christos remove unused variables.
 1.24  27-Oct-2002  christos vi mode and memory fixes from david laight.
 1.23  27-Oct-2002  christos don't crash in memory shortage conditions.
 1.22  09-Apr-2002  thorpej _rl_qsort_string_compare(): Fix casts. This makes gcc 3.2 happy,
and also allows both LINTED comments to be removed.
 1.21  18-Mar-2002  christos Add a couple linted comment and enable WARNS=3
 1.20  18-Mar-2002  christos - constify; passes all gcc and lint strict checks.
- add config.h [Jason Evans], to create a portable version of libedit that
can be easily compiled on other OS's.
 1.19  10-Jan-2001  jdolecek fix partial completion - we failed to refresh screen in that case
 1.18  05-Jan-2001  christos depoison the pure editline code from readline compatibility hacks.
 1.17  05-Jan-2001  jdolecek Standard location of readline headers is /usr/include/readline/, so install
them there.
readline.h of libedit had to move to subdirectory 'readline', due to the way
BSD makefiles work; this is better than potentially fragile Makefile hacks
 1.16  04-Jan-2001  christos fix lint problems.
 1.15  01-Jan-2001  jdolecek Add support for rl_completion_append_character and rl_special_prefixes.
This addresses lib/10513 by Giles Lean. Tested with PostgreSQL 7.0.2 psql.
 1.14  01-Jan-2001  jdolecek history_tokenize(): fix one off-by-one bug
rl_complete_internal(): only replace the completed string with common part
of possible matches if there is a possible completion
 1.13  31-Dec-2000  jdolecek rl_display_match_list():
* pad entries shorter than 'max' by spaces correctly
* fix off-by-one error which caused extra newline to be printed
if the list fit exactly to a screen
* fix typo in _rl_qsort_string_compare, which caused the list to not
be sorted after all
 1.12  23-Dec-2000  jdolecek completion_matches(): fix a off-by-one bug, fix variable name typo
implement displaying of possible completions, add hook to display the list
on second rl_complete() invocation in row (typically, double <TAB>)

This addresses the completion part of lib/11581 by Richard Earnshaw.
 1.11  04-Sep-2000  lukem convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
 1.10  10-Mar-2000  jdolecek Fix _rl_compat_sub() to really honour 'globally' flag instead
of making the substitution always globally - affects
_history_expand_command() and in turn history_expand()

All praise lint :)
 1.9  10-Mar-2000  jdolecek readline(): don't dereference NULL pointer if prompt is NULL
history_tokenize(): avoid stepping too far if backslash is last character
on the passed string
update some comments

This makes gdb \ escaping work reliably and fixes lib/9511 by Assar Westerlund.
 1.8  03-Jul-1999  lukem don't try to free() something allocated with alloca() in rl_complete_internal().
(noticed while using completion in gdb and getting inundated with warnings from
the new free())
 1.7  02-Jul-1999  simonb More trailing white space.
 1.6  12-Jun-1999  christos Make this compile under linux
 1.5  12-Dec-1998  christos many problems; variables hidden by others, size_t <-> confusion
 1.4  20-May-1998  christos Adjust to the libedit api changes.
 1.3  12-Nov-1997  thorpej el_gets() takes an int *, not a size_t *.
 1.2  23-Oct-1997  christos Const de-poisoning :-( Unfortunately the default gnu readline does not
have full prototypes... With those changes, and a single line change in
gdb/top.c, gdb links with -ledit
 1.1  23-Oct-1997  christos PR/4301: Jaromir Dolecek. Add gnu-readline wrapper for editline.
 1.49.2.4  12-Jul-2005  tron Pull up revision 1.52 (requested by lukem in ticket #542):
check for pwd != NULL, fix a missed getpwnam.
 1.49.2.3  12-Jul-2005  tron Pull up revision 1.50 (requested by lukem in ticket #542):
use getpwent_r
 1.49.2.2  28-May-2005  tron Pull up revision 1.55 (requested by agc in ticket #353):
Use the correct type for the stored callback function
 1.49.2.1  28-May-2005  tron Pull up revision 1.54 (requested by agc in ticket #353):
Sync the alternative readline interface with reality:
+ the rl_callback_handler_install takes a pointer to a void function
which has one char * argument (it's called that way in the readline
emulation source, otherwise there's no way to pass the line buffer
to the function which processes the line when EOL is encountered)
+ provide a prototype for that function signature and use it
Makes the callback readline interface work now.
 1.74.2.1  18-May-2008  yamt sync with head.
 1.78.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.99.2.5  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.99.2.4  23-Jan-2013  yamt sync with head
 1.99.2.3  30-Oct-2012  yamt sync with head
 1.99.2.2  23-May-2012  yamt sync with head.
 1.99.2.1  17-Apr-2012  yamt sync with head
 1.100.2.1  05-Jun-2012  bouyer Pull up following revision(s) (requested by christos in ticket #309):
lib/libedit/readline.c: revision 1.104
don't crash if add_history is called from an empty line. Called from
nslookup in new bind.
XXX: pullup to 6
 1.105.2.4  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.105.2.3  23-Jun-2013  tls resync from head
 1.105.2.2  25-Feb-2013  tls resync with head
 1.105.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.110.2.1  10-Aug-2014  tls Rebase.
 1.111.2.1  13-May-2015  martin Sync lib/libedit with head, requested by christos in #753:

lib/libedit/Makefile 1.53
lib/libedit/chartype.h 1.13
lib/libedit/editline.3 1.83-1.84
lib/libedit/editrc.5 1.28-1.29
lib/libedit/eln.c 1.18
lib/libedit/filecomplete.c 1.33-1.34
lib/libedit/readline.c 1.112-1.115

Man page improvements, fix overlapping strcpy, improve readline
compatibility, clang build fix.
 1.136.2.3  26-Apr-2017  pgoyette Sync with HEAD
 1.136.2.2  20-Mar-2017  pgoyette Sync with HEAD
 1.136.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.140.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.146.2.3  18-Jan-2019  pgoyette Synch with HEAD
 1.146.2.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.146.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.147.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.147.2.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed