NetBSD/lib/libedit
christos 2884af9fee From Ingo Schwarze:
el_getc() for the WIDECHAR case, that is, the version in eln.c.
For a UTF-8 locale, it is broken in four ways:

 1. If the character read is outside the ASCII range, the function
    does an undefined cast from wchar_t to char.  Even if wchar_t
    is internally represented as UCS-4, that is wrong and dangerous
    because characters beyond codepoint U+0255 get their high bits
    truncated, meaning that perfectly valid printable Unicode
    characters get mapped to arbitrary bytes, even the ASCII escape
    character for some Unicode characters.  But wchar_t need not
    be implemented in terms of UCS-4, so the outcome of this function
    is undefined for any and all input.

 2. If insufficient space is available for the result, the function
    fails to detect failure and returns garbage rather than -1 as
    specified in the documentation.

 3. The documentation says that errno will be set on failure, but
    that doesn't happen either in the above case.

 4. Even for ASCII characters, the results may be wrong if wchar_t
    is not using UCS-4.
2016-02-14 17:06:24 +00:00
..
readline remove duplicate declaration 2015-06-02 15:36:45 +00:00
TEST cast gotsig because it is long on some systems. 2014-06-18 20:12:15 +00:00
chared.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
chared.h From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
chartype.c From Ingo Schwartze: 2016-02-14 14:47:48 +00:00
chartype.h From Ingo Schwarze: 2016-02-14 17:06:24 +00:00
common.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
config.h better autoconf results 2011-07-29 20:57:34 +00:00
editline.3 Fix descriptions of el_set functions. 2015-11-03 21:36:59 +00:00
editrc.5 Bump date for previous. 2014-12-25 13:39:41 +00:00
el.c - Add some more Char casts 2016-02-11 19:21:04 +00:00
el.h GC IGNORE_EXTCHARS and simplify code (Ingo Schwarze) 2016-02-12 15:36:08 +00:00
eln.c From Ingo Schwarze: 2016-02-14 17:06:24 +00:00
emacs.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
filecomplete.c callers's -> caller's 2014-10-18 15:07:02 +00:00
filecomplete.h Wide character support (UTF-8) from Johny Mattsson; currently disabled. 2009-12-30 22:37:40 +00:00
hist.c KNF return (\1); -> return \1; 2011-07-29 15:16:33 +00:00
hist.h Whitespace fix (Ingo Schwarze) 2016-01-30 15:05:27 +00:00
histedit.h Don't depend on weak aliases to define the vi "alias" expansion function, 2014-06-18 18:12:28 +00:00
history.c Add a history function that takes a FILE pointer; needed for Capsicum. 2014-05-11 01:05:17 +00:00
keymacro.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
keymacro.h One macro is enough (Ingo Schwarze) 2016-01-29 19:59:11 +00:00
Makefile Disable -Wcast-qual for clang for now. 2015-01-29 20:30:02 +00:00
makelist From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
map.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
map.h Bounds search for reallocated index, from OpenBSD via Andreas Fett 2014-07-06 18:15:34 +00:00
parse.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
parse.h Wide character support (UTF-8) from Johny Mattsson; currently disabled. 2009-12-30 22:37:40 +00:00
prompt.c KNF return (\1); -> return \1; 2011-07-29 15:16:33 +00:00
prompt.h Wide character support (UTF-8) from Johny Mattsson; currently disabled. 2009-12-30 22:37:40 +00:00
read.c From Ingo Schwartze: 2016-02-14 14:47:48 +00:00
read.h Wide character support (UTF-8) from Johny Mattsson; currently disabled. 2009-12-30 22:37:40 +00:00
readline.c Adjust API to a more modern readline (Ryo Onodera) 2015-06-02 15:35:31 +00:00
refresh.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
refresh.h From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
search.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
search.h From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
shlib_version provide an el_init_fd function. 2013-01-22 20:23:21 +00:00
sig.c kill ptr_t and ioctl_t, add * sizeof(*foo) to all allocations. 2011-07-28 20:50:55 +00:00
sig.h reset and redraw on sigcont. From Anon Ymous. 2009-02-19 15:20:22 +00:00
sys.h - Add some more Char casts 2016-02-11 19:21:04 +00:00
terminal.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
terminal.h From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
tokenizer.c Fix misplaced parentheses (Ingo Schwarze) 2016-01-30 04:02:51 +00:00
tty.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00
tty.h more tty modes refactoring, no functional change intended. 2014-05-19 19:54:12 +00:00
vi.c From Ingo Schwarze: 2016-02-14 14:49:34 +00:00