History log of /netbsd-src/lib/libedit/chared.c (Results 1 – 25 of 64)
Revision Date Author Comments
# 62c70a72 29-Jun-2024 christos <christos@NetBSD.org>

Prevent testing out of bounds memory. From Robert Morris
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279762


# 21a4b1cc 30-Oct-2022 christos <christos@NetBSD.org>

improvements in malloc/free handling.


# 65744508 08-Feb-2022 rillig <rillig@NetBSD.org>

libedit: fix typos, apply KNF to newly imported code (PR/56693)

No binary change.


# 001f54a4 08-Feb-2022 christos <christos@NetBSD.org>

PR/56693: Walter Lozano: Add support for rl_delete_text and rl_set_key


# b7e56637 11-Jan-2022 christos <christos@NetBSD.org>

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_sa

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

show more ...


# 113f06a3 23-Jul-2019 christos <christos@NetBSD.org>

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 reallo

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.

show more ...


# 38ee0c7e 23-Jul-2019 christos <christos@NetBSD.org>

PR/54400: Sören Tempel: out-of-bounds read in libedit c_delbefore


# cf2b6f69 11-Oct-2017 abhinav <abhinav@NetBSD.org>

Fix typo in comment


# bb64d9f1 22-May-2016 christos <christos@NetBSD.org>

Stop the read module from poking the el_chared.c_macro data structure
currently belonging to the chared module. The read module does so
from three of its functions, while no other module uses the ma

Stop the read module from poking the el_chared.c_macro data structure
currently belonging to the chared module. The read module does so
from three of its functions, while no other module uses the macro
data, not even the chared module itself. That's quite logical
because macros are a feature of input handling, all of which is
done by the read module, and none by the chared module. So move
the data into the read modules's own opaque data structure, struct
el_read_t.

That simplifies internal interfaces in several respects: The
semi-public chared.h has one fewer struct, one fewer #define, and
one fewer member in struct el_chared_t; all three move to one single
C file, read.c, and are now module-local. And the internal interface
function ch_reset() needs one fewer argument, making the code of many
functions in various modules more readable.

The price is one additional internal interface function, read_end(),
10 lines long including comments, called publicly from exactly one
place: el_end() in el.c. That's hardly an increase in complexity
since most other modules already have their *_end() function, read.c
was the odd one out not having one.

From Ingo Schwarze

show more ...


# a2d6b270 09-May-2016 christos <christos@NetBSD.org>

s/protected/libedit_private/g


# 4fc1f47d 18-Apr-2016 christos <christos@NetBSD.org>

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

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.

show more ...


# 469d44f8 11-Apr-2016 christos <christos@NetBSD.org>

Get rid of private/public; keep protected (Ingo Schwarze)


# 0594af80 11-Apr-2016 christos <christos@NetBSD.org>

Char -> wchar_t from Ingo Schwarze.


# 0aefc7f9 11-Apr-2016 christos <christos@NetBSD.org>

more macro WIDECHAR undoing from Ingo Schwarze.


# fcf85103 09-Apr-2016 christos <christos@NetBSD.org>

More WIDECHAR elimination (Ingo Schwarze)


# 5f47d9bd 24-Feb-2016 christos <christos@NetBSD.org>

A very simple, non-intrusive patch to fix a segfault (and a
functional error) in c_gets(), file chared.c.

Run any program using libedit in the default way. At the el_[w]gets()
prompt, invoke ed-com

A very simple, non-intrusive patch to fix a segfault (and a
functional error) in c_gets(), file chared.c.

Run any program using libedit in the default way. At the el_[w]gets()
prompt, invoke ed-command (for example, in emacs mode, press the
escape key, then type the letter 'x'). You should see a ": " prompt.
Type the letter 'x' again. Now press the backspace key a few times,
looking at the screen after each key press:

- The 1st BS deletes the 'x'.
- The 2nd BS deletes the blank after the prompt.
- The 3rd BS deletes the colon of the prompt.
- The 4th BS moves the cursor up one line.
- The 5th BS gives me "Segmentation fault (core dumped)".

Depending on your platform, it might take a few more or a few less
backspaces for the buffer underrun to trigger the segfault, but
you should be able to hit it sooner or later no matter what.

Run the same program again, connect again and invoke ed-command again.
Now type: 'b', backspace, 'i', backspace, 'n', backspace, 'd', enter.
The "bind" command gets executed, even though you deleted what you
typed before hitting enter.

From Ingo Schwatze.

show more ...


# 7ba8c71b 24-Feb-2016 christos <christos@NetBSD.org>

Get split el_getc and el_wgetc completely and call el_wgetc internally.
Change some character constants to they wide versions. (Ingo Schwarze)


# 22383670 17-Feb-2016 christos <christos@NetBSD.org>

whitespace and header sorting changes (Ingo Schwarze). No functional changes.


# e84df91e 16-Feb-2016 christos <christos@NetBSD.org>

More header cleanups from Ingo Schwarze.


# 747f6811 16-Feb-2016 christos <christos@NetBSD.org>

more include file cleanup (Ingo Schwarze)


# aefc1e44 16-Feb-2016 christos <christos@NetBSD.org>

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 ma

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...

show more ...


# f09cb8c6 16-Feb-2016 christos <christos@NetBSD.org>

cleanup chartype.h includes (Ingo Schwarze)


# 40850369 16-Feb-2016 christos <christos@NetBSD.org>

cleanup inclusion of histedit.h (Ingo Schwarze)


# f54e4f97 14-Feb-2016 christos <christos@NetBSD.org>

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 o

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.

show more ...


# e06822a7 18-Jun-2014 christos <christos@NetBSD.org>

Don't depend on weak aliases to define the vi "alias" expansion function,
provide an API instead to set it.


123