Home | History | Annotate | Download | only in libedit
History log of /src/lib/libedit/parse.c
RevisionDateAuthorComments
 1.42  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.41  29-Nov-2018  christos Fix off by one <tsahara at iij>
 1.40  09-May-2016  christos branches: 1.40.14; 1.40.16;
s/protected/libedit_private/g
 1.39  11-Apr-2016  christos Fix indentation, Ingo Schwarze
 1.38  11-Apr-2016  christos Get rid of private/public; keep protected (Ingo Schwarze)
 1.37  11-Apr-2016  christos Char -> wchar_t from Ingo Schwarze.
 1.36  11-Apr-2016  christos more macro WIDECHAR undoing from Ingo Schwarze.
 1.35  17-Feb-2016  christos whitespace and header sorting changes (Ingo Schwarze). No functional changes.
 1.34  16-Feb-2016  christos More header cleanups from Ingo Schwarze.
 1.33  16-Feb-2016  christos more include file cleanup (Ingo Schwarze)
 1.32  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.31  16-Feb-2016  christos cleanup chartype.h includes (Ingo Schwarze)
 1.30  16-Feb-2016  christos cleanup inclusion of histedit.h (Ingo Schwarze)
 1.29  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.28  11-Feb-2016  christos - Add some more Char casts
- reduce ifdefs by providing empty defs for nls functions (Ingo Schwarze)
 1.27  06-Jul-2014  christos Bounds search for reallocated index, from OpenBSD via Andreas Fett
 1.26  16-Aug-2011  christos branches: 1.26.8; 1.26.18;
re-enable -Wconversion
 1.25  29-Jul-2011  christos KNF return (\1); -> return \1;
 1.24  28-Jul-2011  christos term -> terminal
XXX: need to rename key_ too.
 1.23  30-Dec-2009  christos Wide character support (UTF-8) from Johny Mattsson; currently disabled.
 1.22  29-May-2005  lukem Update for recent parse__escape() prototype change
 1.21  29-May-2005  christos PR/25694: Luke Mewburn: Don't abuse unconstify'ing a string and writing to
it, because you'll core dump. Also remove extra const that gives pain to
the irix compiler.
 1.20  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.19  02-Nov-2003  christos Handle M- as escape. XXX: should probably select the meta-map instead.
From Gerry Swislow gerry at certif com
 1.18  15-Oct-2003  christos don't limit ^c to alpha c, and add VIS_NOSLASH so that vis(3) does not
produce \^c
 1.17  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.16  21-Jan-2003  christos Add a uniquefier for the history function.
 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  23-Jan-2001  jdolecek sprinkle couple const
 1.13  04-Sep-2000  lukem convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
 1.12  10-Mar-2000  jdolecek include <stdlib.h> to get definition of malloc() and free(), so it's
possible to compile this file separately when debugging
 1.11  02-Jul-1999  simonb More trailing white space.
 1.10  05-Feb-1999  christos M-X:<enter> core-dumped.
 1.9  12-Dec-1998  christos delint
 1.8  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.7  21-Jan-1998  lukem in el_parse(), use a temporary buffer to store the program name when
comparing, preventing trashing of argv[0]. remove note in man page
warning of former behaviour.
 1.6  06-Jul-1997  christos Fix compiler warnings.
 1.5  11-Jan-1997  lukem * document ^char and \ escape sequences
* when parsing ^char control chars, check the correct char when determining
validity (previously, ^char was a NOP interpreted as the literal string
because of this bug)
 1.4  11-Jan-1997  lukem RCSid police
editline first appeared in 4.4BSD not NetBSD1.0
 1.3  11-Jan-1997  lukem * in el_parse(), don't reference argv[0] if argc < 1 (return -1 instead)
* clarify return value of el_parse()
 1.2  09-Jan-1997  lukem * add a man page for the editline routines
* add a man page describing editrc
* fix bugs in el_parse():
* didn't execute command when program name matched (test reversed)
* was checking against empty string instead of program name
* after checks, command to run also pointed to empty string

[christos - the author of libedit - ok-ed the man pages in general (which I
wrote from scratch by RTFS) as well as the bugfix]
 1.1  06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  06-May-1994  cgd libedit!
 1.26.18.1  10-Aug-2014  tls Rebase.
 1.26.8.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.40.16.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.40.16.1  10-Jun-2019  christos Sync with HEAD
 1.40.14.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts

RSS XML Feed