summaryrefslogtreecommitdiff
path: root/lib/libedit
AgeCommit message (Collapse)Author
2016-03-20Use getline(3) rather than fgetln(3) because it is standardizedIngo Schwarze
and simpler and safer to use. Implemented by Christos Zoulas following my suggestion, with a bug fix by me.
2016-03-20minor simplifactions, style fixes, and trivial syncs from NetBSDIngo Schwarze
2016-03-20Fix the same bug again that was already fixed in:Ingo Schwarze
OpenBSD tokenizer.c rev. 1.8 2003/08/11 18:21:40 deraadt Don't increase amax on realloc() failure. The original fix got lost in a merge along the way. This fix from Christos Zoulas via NetBSD tokenizer.c rev. 1.23 2016/02/15. OK czarkoff@
2016-03-20Delete the useless Int datatype and always use the standard wint_tIngo Schwarze
directly. This is not a problem because <wchar_t> is required all over the place anyway, even when WIDECHAR is not defined. No functional change except that it fixes a few printf(3) format string issues, %c vs. %lc. OK czarkoff@
2016-03-20Get rid of "#ifdef WIDECHAR" and one goto in read_char(),Ingo Schwarze
making the code more readable. Instead, provide an mbrtowc(3) replacement function in chartype.[hc], files that encapsulate such system dependencies anyway. No functional change. OK czarkoff@
2016-03-20Delete the weird IGNORE_EXTCHARS flag, simplifying the codeIngo Schwarze
in the generic low-level function read_char(). Until we fully enable UTF-8 support, instead filter out non-ASCII characters in the more logical place in the high-level function el_gets(3). OK czarkoff@.
2016-03-20Fix the public interface function el_getc(3).Ingo Schwarze
On OpenBSD, the effects are to set the return argument to the NUL byte in case of a read failure (for robustness) and to properly set errno when the character is out of range and cannot be stored in a byte. Once we enable UTF-8, this will be needed to avoid returning bogus bytes for valid Unicode characters. On systems where the internal representation of wchar_t doesn't match UCS-4, breakage was potentially even worse. OK czarkoff@.
2016-03-20Fix read_char() for the non-UTF-8 case, in particular for systemsIngo Schwarze
supporting other multibyte locales or having an internal representation of wchar_t that doesn't match UCS-4. No functional change on OpenBSD, but it makes the code less confusing. OK czarkoff@.
2016-03-20Fix the CHARSET_IS_UTF8 case in read_char().Ingo Schwarze
For now, this mainly help programs explicitly using wide-character functions like el_wgetc(3) and el_wgets(3). 1. After reading an invalid byte sequence, do not throw away additional valid bytes; fix by me using mbrtowc(3), obsoleting utf8_islead(). 2. When read(2) returns EOF, return that information to the caller, do not prod on and potentially access garbage data in the buffer; from Linas Vepstas via NetBSD read.c rev. 1.70 2013/05/27. 3. After read__fixio() failure, restore errno to the one set by read(); from Steffen Nurpmeso via NetBSD read.c rev. 1.68 2012/09/10. 4. After read__fixio() success, restore errno to the initial state upon function entry; fix by me. OK czarkoff@. Also committed to NetBSD.
2016-03-20Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])Kenneth R Westerback
idioms. Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0) where it is obvious further investigation will not yield and even better way. Obviousness evaluation and ok guenther@
2016-03-01Fix a segfault and functional error in c_gets(),Ingo Schwarze
which is used for extended command input and for vi search mode. It could be triggered by typing one or more characters, then pressing backspace once (functional error: the character was deleted from the screen, but not from the edit buffer) or a few more times than characters had been entered (segfault). OK czarkoff@. Also checked by Christos Zoulas.
2016-02-02Get rid of an ugly #ifdef in the middle of el_init() byIngo Schwarze
hiding the system dependencies away in "sys.h" where they belong. No binary change on OpenBSD. Seems reasonable to christos at NetBSD, too.
2016-01-31remove some whitespace differences with NetBSD; no change with diff -bIngo Schwarze
2016-01-31trivial partial sync to NetBSD, no functional change:Ingo Schwarze
* remove unused ifdef'ed header junk * remove pointless cast of NULL * wrap two excessively long lines
2016-01-30Fifth step in synching with NetBSD:Ingo Schwarze
Delete the silly ptr_t and ioctl_t typedefs and delete some "#ifdef notdef" code from "sys.h". No functional change. This makes hist.h identical to the NetBSD version. It reduces the remaining diff from +1526 -734 to +1430 -592. OK czarkoff@
2016-01-30Fourth step in synching with NetBSD:Ingo Schwarze
KNF: Remove parentheses from return lines. No object change. This makes emacs.c and prompt.c identical to the NetBSD versions. It reduces the remaining diff from +2053 -1261 to +1526 -734. OK czarkoff@
2016-01-30delete "#ifdef notdef" code that is no longer present in NetBSD;Ingo Schwarze
no change in the generated source files
2016-01-30Third step in synching with NetBSD:Ingo Schwarze
* rename fkey_t to funckey_t and el_term_t to el_terminal_t * rename struct editline member el_term to el_terminal * rename many functions in terminal.c from term_*() to terminal_*(), for consistency with the file name and to not look related to <term.h> No functional change. This makes refresh.c and sig.c almost identical to the NetBSD versions. It reduces the remaining diff from +2446 -1805 to +2053 -1420. OK czarkoff@
2016-01-29Second step in synching with NetBSD:Ingo Schwarze
* Rename some types from *key*_t to *keymacro*_t. * Rename struct editline member el_key to el_keymacro. * Rename some functions in keymacro.c from key*() to keymacro*(). This removes the conflict of key_clear(), key_end(), and key_print() with macros in <term.h>. No functional change. This makes keymacro.h identical to the NetBSD version. It reduces the remaining diff from +2640 -1998 to +2446 -1805. OK czarkoff@
2016-01-29Start synching with NetBSD:Ingo Schwarze
Rename the files key.[hc] to keymacro.[hc] and term.[hc] to terminal.[hc]. The change makes sense because "term.h" conflicts with <term.h> and the functions key_clear(), key_end(), and key_print() in "key.h" conflict with macros in <term.h>. No content change yet, no binary change in *.o after "strip -d". This reduces the remaining diff from +4634 -3992 to +2640 -1998. OK czarkoff@, and mmcc@ agrees with the direction.
2016-01-08Zap extraneous SYNOPSIS sections.Vadim Zhukov
The gettytab(5) and termcap(5) get FILES, others don't need anything. With input from & okay schwarze@
2015-09-14in the SYNOPSIS, make void function arguments explicitIngo Schwarze
2015-09-10missing commas at the end of .Nm lines in the NAME sectionIngo Schwarze
2015-04-04gcc 2.x is deadPhilip Guenther
ok millert@
2015-03-13remove the first comma from constructs like ", and," and ", or,": you can useJason McIntyre
"and" and "or" to join sentence clauses, and you can use commas, but both hinders reading;
2015-02-06SIZE_MAX is standard, we should be using it in preference to theTodd C. Miller
obsolete SIZE_T_MAX. OK miod@ beck@
2015-01-16Move to the <limits.h> universe.Theo de Raadt
review by millert, binary checking process with doug, concept with guenther
2015-01-13libedit claims compatibility with readline 4.2, so provide a stub forReyk Floeter
rl_set_keyboard_input_timeout() that was added in this version. Also crank the minor version. OK krw@ yasuoka@ deraadt@
2014-12-15merge improvements from NetBSD; ok jmc@ nicm@Ingo Schwarze
2014-12-12markup fixes from Kaspars at Bankovskis dot net;Ingo Schwarze
some of this is already contained upstream in NetBSD, the rest will be sent there
2014-10-17Remove non-exposed malloc/realloc/free wrappers, and then substituteTheo de Raadt
reallocarray() where it helps. ok doug
2014-10-15use reallocarray()Theo de Raadt
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-10-09USE_SHLIBDIR is archaicTheo de Raadt
2014-05-20Merge the fixes from the upstream. Factor out some common code inYASUOKA Masahiko
tty.c and fix EL_SETTY to work. ok nicm
2014-05-20The argv[] used for el_set() EL_BIND, EL_SETTY, etc should be terminatedNicholas Marriott
by NULL. Fix from NetBSD via yasuoka@ but changed by me not to walk off the end of array with >20 arguments. ok yasuoka
2014-05-19Add a H_SAVE_FP operation to history() which lets the history be savedNicholas Marriott
to an open file pointer. From NetBSD via Eitan Adler. ok millert
2014-01-19Retain local changes from rev 1.13.Tobias Stoeckmann
ok deraadt@
2013-08-13Switch time_t, ino_t, clock_t, and struct kevent's ident and dataPhilip Guenther
members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
2013-07-01Link sqlite3(1) against libedit and add an empty history.h header forMartin Pieuchot
compatibility with GNU realine. ok mikeb@, sthen@, espie@
2013-05-22Sync with upstream. Fix buffer growing and memory allocation for wideYASUOKA Masahiko
chars. Handle return of mbstowcs(). ok nickm
2013-01-10editline.3: editrc only read from $HOME; from LEVAI DanielJason McIntyre
editrc.5: add FILES for ~/.editrc patches passed onto net/free
2012-09-04remove lint leftovers; ok guenther@Okan Demirmen
2012-08-02remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.Okan Demirmen
ok guenther@
2011-11-27Don't segfault when trying to bind to an invalid command. While here,Pascal Stumpf
kill a C++-style comment. ok nicm@
2011-11-17Calculate the size for the wchar_t argv correctly, fixes memoryNicholas Marriott
corruption reported by LEVAI Daniel <leva at ecentrum dot hu>. Also rename "bytes" to "wlen" since bytes is not accurate, suggested by stsp@. ok stsp oga
2011-07-13Reintroduce lost local diff; detective work by matthew@; ok okan@ oga@Otto Moerbeek
all hail the more strict malloc S flag!
2011-07-08el_set EL_BIND or EL_SETTC must have argument lists ending with NULL.Nicholas Marriott
ok tedu
2011-07-07Enable wide character functions in libedit (not the other libe*t).Nicholas Marriott
ok stsp deraadt