Commit Graph

46 Commits

Author SHA1 Message Date
christos 7a0279c013 Remove unused stuff, and limit the scope of some of the used ones.
(from des@freebsd)
2023-02-04 14:34:28 +00:00
christos 21a4b1ccc3 improvements in malloc/free handling. 2022-10-30 19:11:31 +00:00
christos e2b95d2cb4 Add casts to appease conversions between wchar_t and wint_t 2021-09-09 20:24:07 +00:00
christos 6953eca8c7 Fix numeric variable handling in settc (lyzliyuzhi at 163 dot com) 2020-07-10 20:34:24 +00:00
christos 58b288d88d use strlcpy() instead of strncpy() for gcc happiness 2020-05-31 23:24:23 +00:00
christos b9ecc063aa PR/54654: Soren Tempel: Make sure el_cursor.v < el_terminal.t_size.v when
moving around.
2019-11-12 20:59:46 +00:00
christos a5a5a01f84 Fix type and remove cast (Yuichiro NAITO/FreeBSD). 2019-09-15 21:09:11 +00:00
christos 113f06a345 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.
2019-07-23 10:18:52 +00:00
christos ac94b724c0 Add a comment explaining why we don't use DO here. Correct the attribution
on the previous patch: The patch was from Jordan Lewis and the report from
Raphael Poss.
2019-06-30 13:30:15 +00:00
christos 0d31660187 PR/54329: Raphael Ross: According to https://www.gnu.org/software/termutils/\
manual/termcap-1.3/html_chapter/termcap_4.html#SEC23 the cursor move multiple
escapes have undefined results when moving out of the screen. Stop using DO
to move down multiple lines and use a loop of newlines instead.
2019-06-29 21:35:09 +00:00
christos 2f37aad7a2 PR/52359: Benjamin Lorenz: When resizing because of a signal save and restore
the cursor position, since it does not change.
2019-04-12 17:30:49 +00:00
christos 52b10dfde0 PR/53983: Jonathan Perkins: Fix types for readline compatibility 2019-02-15 23:20:35 +00:00
christos e06500e20d PR/53682: Jordan Lewis: use newlines instead of padded spaces when restoring
multi-line histories.
2018-11-24 12:17:35 +00:00
christos 06d596a8e9 - handle literal escape sequence printing.
- factor out common code in allocation and freeing of the display.
2017-06-27 23:23:09 +00:00
christos a2d6b270ec s/protected/libedit_private/g 2016-05-09 21:46:56 +00:00
christos 300e2ca473 eliminate static buffer with custom resizing code. 2016-05-02 16:48:34 +00:00
christos 4fc1f47d56 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.
2016-04-18 17:01:19 +00:00
christos 469d44f8e7 Get rid of private/public; keep protected (Ingo Schwarze) 2016-04-11 18:56:31 +00:00
christos 0594af8028 Char -> wchar_t from Ingo Schwarze. 2016-04-11 00:50:13 +00:00
christos 0aefc7f9ad more macro WIDECHAR undoing from Ingo Schwarze. 2016-04-11 00:22:48 +00:00
christos fcf85103b4 More WIDECHAR elimination (Ingo Schwarze) 2016-04-09 18:43:17 +00:00
christos 4e541d85ca Start removing the WIDECHAR ifdefs; building without it has stopped working
anyway. (Ingo Schwarze)
2016-03-23 22:27:48 +00:00
christos 62666ab4cc put back NUL check (Ingo Schwarze) 2016-03-22 01:38:17 +00:00
christos d784c57539 PR/50880: David Binderman: Remove redundant code.
While here, fix all debugging formats.
2016-03-02 19:24:20 +00:00
christos 22383670cc whitespace and header sorting changes (Ingo Schwarze). No functional changes. 2016-02-17 19:47:49 +00:00
christos aefc1e4460 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...
2016-02-16 15:53:48 +00:00
christos f09cb8c626 cleanup chartype.h includes (Ingo Schwarze) 2016-02-16 14:08:25 +00:00
christos 40850369f8 cleanup inclusion of histedit.h (Ingo Schwarze) 2016-02-16 14:06:05 +00:00
christos 67b10d3e9e OpenBSD term.c rev. 1.7 2002/11/29 20:13:39 deraadt
spelling
2016-02-15 22:53:38 +00:00
christos efeef4e587 OpenBSD term.c rev. 1.13 2009/12/11 18:58:59 jacekm
fix two memory leaks
2016-02-15 15:35:03 +00:00
christos f54e4f97f9 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.
2016-02-14 14:49:34 +00:00
christos 6af8d6733f - Add some more Char casts
- reduce ifdefs by providing empty defs for nls functions (Ingo Schwarze)
2016-02-11 19:21:04 +00:00
christos d22248f82d don't include both term.h and termcap.h 2012-05-30 18:21:14 +00:00
christos fac360ff28 From: Jilles Tjoelker: Add a mapping for the cursor delete key 2012-03-24 20:09:30 +00:00
christos 36e7768bff Initialize termbuf (Kamil Dudka) 2011-11-18 20:32:00 +00:00
christos d24c721eac check for negative return of ct_visual_char (Kamil Dudka) 2011-11-18 20:25:48 +00:00
christos b6f308812d fixed warnings where wint_t is unsigned. 2011-10-04 15:27:04 +00:00
christos 8c9fc8838c fix broken change (parenthesis in the wrong place). From Nirbhay Choubey 2011-10-03 14:09:38 +00:00
christos 3d802cf59d re-enable -Wconversion 2011-08-16 16:25:15 +00:00
christos c11bd863f5 pass -Wconversion 2011-07-29 23:44:44 +00:00
christos 7ecb1ef25e kill ifdef notdef 2011-07-29 15:20:39 +00:00
christos b71bed95b3 KNF return (\1); -> return \1; 2011-07-29 15:16:33 +00:00
christos a13cd75612 kill ptr_t and ioctl_t, add * sizeof(*foo) to all allocations. 2011-07-28 20:50:55 +00:00
christos 7da8639ecc whitespace 2011-07-28 03:52:19 +00:00
christos d47f958456 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.
2011-07-28 01:56:26 +00:00
christos 98c7cbebbc term -> terminal
XXX: need to rename key_ too.
2011-07-28 01:05:20 +00:00