Home | History | Annotate | Download | only in libedit
History log of /src/lib/libedit/map.c
RevisionDateAuthorComments
 1.56  03-Jan-2025  rillig libedit: remove redundant break statements after EL_ABORT
 1.55  30-Oct-2022  christos improvements in malloc/free handling.
 1.54  29-Aug-2021  christos ^W is traditionally bound to ed-delete-prev-word and not kill-region
^R is traditionally bound to em-inc-search-next and not redisplay
This is what mksh, zsh bash, readline do (Baptiste Daroussin)
 1.53  30-Mar-2020  ryo fix build error with SDEBUG, MAP_DEBUG, DEBUG_REFRESH
 1.52  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.51  09-May-2016  christos branches: 1.51.16;
s/protected/libedit_private/g
 1.50  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.49  17-Apr-2016  christos Remove empty callbacks (Ingo Schwartze)
 1.48  12-Apr-2016  christos From Ingo Schwarze:

* Delete the stubs of the XK_EXE mechanism that was never implemented.
From a security, stability, and simplicity perspective, i would
consider implementing it a truly terrible idea, so let's better
get rid of it.

* Do not use the local variable "num" in el_wgets() alternately for
two completely different purposes. Only use it for the number
of characters read, as stated in the comment (or -1 as long as
that number is still unknown), not for the (more or less boolean)
return value of read_getcmd(). Actually, there is no need at
all to save the latter return value after testing it once.

* The function read_getcmd() has very unusual return values:
It returns -1 for success and 0 for EOF/error. Switch that around
to 0 for success and -1 for EOF/error to be less confusing, and
get rid of the OKCMD preprocessor macro.

* Get rid of one #ifdef section in el_wgets() by using
el->el_chared.c_macro directly at the only place
where it is used.

* Delete the unused MIN() macro.
 1.47  11-Apr-2016  christos Get rid of private/public; keep protected (Ingo Schwarze)
 1.46  11-Apr-2016  christos Char -> wchar_t from Ingo Schwarze.
 1.45  11-Apr-2016  christos more macro WIDECHAR undoing from Ingo Schwarze.
 1.44  09-Apr-2016  christos More WIDECHAR elimination (Ingo Schwarze)
 1.43  17-Feb-2016  christos whitespace and header sorting changes (Ingo Schwarze). No functional changes.
 1.42  16-Feb-2016  christos More header cleanups from Ingo Schwarze.
 1.41  16-Feb-2016  christos more include file cleanup (Ingo Schwarze)
 1.40  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.39  16-Feb-2016  christos cleanup chartype.h includes (Ingo Schwarze)
 1.38  16-Feb-2016  christos cleanup inclusion of histedit.h (Ingo Schwarze)
 1.37  14-Feb-2016  christos From Ingo Schwarze:

As we have seen before, "histedit.h" can never get rid of including
the <wchar.h> header because using the data types defined there is
deeply ingrained in the public interfaces of libedit.

Now POSIX unconditionally requires that <wchar.h> defines the type
wint_t. Consequently, it can be used unconditionally, no matter
whether WIDECHAR is active or not. Consequently, the #define Int
is pointless.

Note that removing it is not gratuitious churn. Auditing for
integer signedness problems is already hard when only fundamental
types like "int" and "unsigned" are involved. It gets very hard
when types come into the picture that have platform-dependent
signedness, like "char" and "wint_t". Adding yet another layer
on top, changing both the signedness and the width in a platform-
dependent way, makes auditing yet harder, which IMHO is really
dangerous. Note that while removing the #define, i already found
one bug caused by this excessive complication - in the function
re_putc() in refresh.c. If WIDECHAR was defined, it printed an
Int = wint_t value with %c. Fortunately, that bug only affects
debugging, not production. The fix is contained in the patch.

With WIDECHAR, this doesn't change anything. For the case without
WIDECHAR, i checked that none of the places wants to store values
that might not fit in wint_t.

This only changes internal interfaces; public ones remain unchanged.
 1.36  11-Feb-2016  christos - Add some more Char casts
- reduce ifdefs by providing empty defs for nls functions (Ingo Schwarze)
 1.35  14-May-2015  christos fix warnings on ubuntu 32 bit (Miki Rozloznik)
 1.34  06-Jul-2014  christos Bounds search for reallocated index, from OpenBSD via Andreas Fett
 1.33  01-Jan-2013  christos branches: 1.33.6;
remove dead assignment (Christoph Mallon)
 1.32  01-Jan-2013  christos Fix pasto that affected bind -k (Christoph Mallon)
 1.31  18-Nov-2011  christos branches: 1.31.6;
Add coverity annotations about unreachable code (Kamil Dudka)
 1.30  16-Aug-2011  christos branches: 1.30.2;
re-enable -Wconversion
 1.29  29-Jul-2011  christos KNF return (\1); -> return \1;
 1.28  28-Jul-2011  christos kill ptr_t and ioctl_t, add * sizeof(*foo) to all allocations.
 1.27  28-Jul-2011  christos Rename key to keymacro to avoid conflicts with term.h. The renaming of term
to terminal was again to avoid conflicts with term.h. term.h is a moving
namespace violation.
 1.26  28-Jul-2011  christos term -> terminal
XXX: need to rename key_ too.
 1.25  30-Dec-2009  christos Wide character support (UTF-8) from Johny Mattsson; currently disabled.
 1.24  09-Apr-2006  christos fix debugging printf format.
 1.23  06-Mar-2006  christos Print the actual eofc, instead of ^D\b\b.
Change internal character decoding to prevent buffer oveflows.
 1.22  09-Aug-2005  christos Fix two more help iterators. Thanks Stefan Farfeleder!
 1.21  08-Aug-2005  christos Don't add an extra { NULL, 0, NULL } element to the help array. Instead keep
it always the same size as the function array for consistency. Reported in
FreeBSD PR 82381, but fixed differently.
 1.20  13-Aug-2004  mycroft Delete-previous-char and delete-next-char without an argument are not supposed
to modify the yank buffer in Emacs. Make it so.
 1.19  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.18  15-Nov-2002  christos PR/18995: David Laight: libedit fixes for posix conformant sh

The posix 'sh' specification defines vi-mode editing quite tightly.
The netbsd libedit code (used by sh to do this) was missing several
features, there were also minor errors in others.

Compare netbsd sh to the definition available from:
http://www.opengroup.org/onlinepubs/007904975/utilities/sh.html
In particular the following were not supported:
U - undo all changes to line
| - goto column
Y - yank to end of line
y - yank
# - comment out current line
@ - take input from shell alias [1]
G - goto numbered line in history buffer
v - edit history line with vi
_ - append word from last input line
. - redo last command
Other minor changes have also been made.

[1] This needs the shell to define an appropriate routine to
return the text of the alias. There is no requirement that
such a function exist.
 1.17  31-Oct-2002  christos support for % command [matching parens/brackets/braces] on vi modes.
From David Laight, thanks!
 1.16  27-Oct-2002  christos vi mode and memory fixes from david laight.
 1.15  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.14  09-Jan-2001  jdolecek make constant arrays a const
 1.13  04-Jan-2001  christos consistently check for allocation failures and return -1, if we could not
get more memory.
 1.12  11-Nov-2000  christos - add support for home and end keys.
- improve debugging support
 1.11  04-Sep-2000  lukem convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
 1.10  15-Oct-1999  jdolecek don't assume locales are not working - it may not be the case
re_refresh(): cast the character passed to re_addc() to unsigned char,
so we don't end up calling isprint() with negative value
when chars are signed and character value is >= 128
 1.9  02-Jul-1999  simonb branches: 1.9.2;
More trailing white space.
 1.8  12-Dec-1998  christos delint
 1.7  29-Jul-1998  lukem * add more checks for NULL pointers in passed arguments
* implement el_get(EditLine *, int op, void *result), which does the
inverse of el_set()
* add EL_EDITMODE operation to el_set and el_get; if non zero editing
is enabled (the default).
* add "edit on | off" editrc command, which modifies EL_EDITMODE.
users can now add '*:edit off' in ~/.editrc as an advisory to
disable editing.

NOTE: at this time EL_EDITMODE is just an indication of the
state of the 'edit' command. It's up to the application to check
this after el_source() or el_parse() to determine if editing is still
required.
 1.6  30-Mar-1998  mrg use int rather than char as an array index.
 1.5  03-Feb-1998  perry remove obsolete register declarations
 1.4  06-Jul-1997  christos Fix compiler warnings.
 1.3  11-Jan-1997  lukem RCSid police
editline first appeared in 4.4BSD not NetBSD1.0
 1.2  27-Apr-1995  mycroft Trivial code ordering change.
 1.1  06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  06-May-1994  cgd libedit!
 1.9.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.30.2.2  23-Jan-2013  yamt sync with head
 1.30.2.1  17-Apr-2012  yamt sync with head
 1.31.6.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.6.1  25-Feb-2013  tls resync with head
 1.33.6.1  10-Aug-2014  tls Rebase.
 1.51.16.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.51.16.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed