Home | History | Annotate | Download | only in libedit
History log of /src/lib/libedit/vi.c
RevisionDateAuthorComments
 1.64  28-Aug-2021  christos Respect $EDITOR when execution one (Baptiste Daroussin)
 1.63  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.62  09-May-2016  christos branches: 1.62.16;
s/protected/libedit_private/g
 1.61  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.60  11-Apr-2016  christos Get rid of private/public; keep protected (Ingo Schwarze)
 1.59  11-Apr-2016  christos Char -> wchar_t from Ingo Schwarze.
 1.58  11-Apr-2016  christos more macro WIDECHAR undoing from Ingo Schwarze.
 1.57  09-Apr-2016  christos Change some 0's to NULL's from Pedro Giffuni
 1.56  09-Apr-2016  christos More WIDECHAR elimination (Ingo Schwarze)
 1.55  02-Mar-2016  christos PR/50880: David Binderman: Remove redundant code.
While here, fix all debugging formats.
 1.54  17-Feb-2016  christos whitespace and header sorting changes (Ingo Schwarze). No functional changes.
 1.53  16-Feb-2016  christos More header cleanups from Ingo Schwarze.
 1.52  16-Feb-2016  christos more include file cleanup (Ingo Schwarze)
 1.51  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.50  16-Feb-2016  christos cleanup chartype.h includes (Ingo Schwarze)
 1.49  16-Feb-2016  christos cleanup inclusion of histedit.h (Ingo Schwarze)
 1.48  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.47  21-Oct-2015  christos Use the full buffer for the conversion; ideally we should be dynamically
allocating this. From Jilles Tjoelker
 1.46  19-Oct-2015  christos make sure we have space for NUL and NUL terminate buffer array (Jilles Tjoelker)
 1.45  18-Jun-2014  christos Don't depend on weak aliases to define the vi "alias" expansion function,
provide an API instead to set it.
 1.44  18-Jun-2014  christos accomodate FreeBSD's flavor of weak references.
 1.43  16-Jan-2012  christos branches: 1.43.6; 1.43.16;
PR/45843: Henning Petersen: Fix resource leak on error.
 1.42  18-Nov-2011  christos Off by one in allocation could cause buffer overflow (Kamil Dudka)
 1.41  04-Oct-2011  christos branches: 1.41.2;

fixed warnings where wint_t is unsigned.
 1.40  16-Aug-2011  christos re-enable -Wconversion
 1.39  29-Jul-2011  christos pass -Wconversion
 1.38  29-Jul-2011  christos - fix unused params
- unconditionalize vis.h
 1.37  29-Jul-2011  christos KNF return (\1); -> return \1;
 1.36  28-Jul-2011  christos kill ptr_t and ioctl_t, add * sizeof(*foo) to all allocations.
 1.35  28-Jul-2011  christos term -> terminal
 1.34  22-Feb-2011  joerg Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.
 1.33  17-Feb-2011  joerg Deal with changes in the weak_reference semantic in GCC 4.2 and later.
 1.32  23-Oct-2010  christos branches: 1.32.2;
fix fd leak found by Igor Zinovik
 1.31  30-Dec-2009  christos Wide character support (UTF-8) from Johny Mattsson; currently disabled.
 1.30  21-Feb-2009  christos more size_t stuff.
 1.29  15-Feb-2009  christos pass lint on _LP64.
 1.28  06-Feb-2009  sketch branches: 1.28.2;
Portability fix.
 1.27  22-Oct-2006  mrg __weakref__ attribute can not be applied to anything when inside function
scope, so, move the extern of get_alias_text outside vi_alias().

fixes build problems with GCC 4.1-20061021.
 1.26  18-May-2006  christos change __weak_extern to __weak_reference so that gcc4 works.
 1.25  06-Mar-2006  christos Print the actual eofc, instead of ^D\b\b.
Change internal character decoding to prevent buffer oveflows.
 1.24  10-Aug-2005  christos Don't save the el->el_line.cursor over a cv_insert call and use it later
because it might change. From Stefan Farfedeler.
 1.23  09-Aug-2005  christos Don't delete the current line in vi mode when typing 'yy'.
From Stefan Farfeleder.
 1.22  08-Aug-2005  christos Spelling mistakes and comment errors (from FreeBSD via Stefan Farfeleder; many
thanks)
 1.21  25-Apr-2005  matt Terminate the arglist with a NULL instead of 0. (Shuts up gcc4.x)
 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  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.17  04-Jun-2003  matt Only return CC_EOF if ^D (VEOF) was the only thing on the line. Otherwise
beep and don't do anything else. This mimics the behavor of ^D outside in
normal terminal mode. (^D in vi scrolls forwards and as such isn't
appropriate to emulation)
 1.16  10-Mar-2003  dsl Put the __weak_extern() back inside vi_alias, but after the extern for
get_alias_text().
 1.15  10-Mar-2003  he Move the __weak_extern() (ifdef'ed) outside of the vi_alias()
function, so that this compiles again.
 1.14  10-Mar-2003  christos if no __weak_extern, don't even try to do vi_alias.
 1.13  10-Mar-2003  christos fix uninitialized variable.
grr, I want gcc-3.3
 1.12  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.11  31-Oct-2002  christos support for % command [matching parens/brackets/braces] on vi modes.
From David Laight, thanks!
 1.10  27-Oct-2002  christos vi mode and memory fixes from david laight.
 1.9  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.8  04-Sep-2000  lukem convert to new style guide, which includes:
- ansi prototypes & features (such as stdargs)
- 8 space indents
 1.7  02-Jul-1999  simonb More trailing white space.
 1.6  05-Feb-1999  christos delint.
 1.5  12-Dec-1998  christos delint
 1.4  03-Feb-1998  perry remove obsolete register declarations
 1.3  06-Jul-1997  christos Fix compiler warnings.
 1.2  11-Jan-1997  lukem RCSid police
editline first appeared in 4.4BSD not NetBSD1.0
 1.1  06-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  06-May-1994  cgd libedit!
 1.28.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.32.2.1  05-Mar-2011  bouyer Sync with HEAD
 1.41.2.1  17-Apr-2012  yamt sync with head
 1.43.16.1  10-Aug-2014  tls Rebase.
 1.43.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.62.16.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411

RSS XML Feed