Age | Commit message (Collapse) | Author |
|
ok deraadt
|
|
contained more than twice as many entries as the new limit: The
argument of remove_history() only counts existing elements, not
those previously deleted.
Crash found by bentley@ when exiting sqlite3(1).
|
|
OK czarkoff@
|
|
Restoring the original errno found in el_wgetc() after
el_wgets() did some cleanup that may have changed errno.
Improve clarity and robustness of the code by not setting and
inspecting el_errno where it isn't needed; in particular, let
keymacro_get() properly report read failure to read_getcmd().
Move el_errno to el_read_t because it's only used in read.c.
Never set errno back to zero.
Checked with a test program installing a USR1 signal handler
without SA_RESTART, for the cases read_getcmd(), ed_quoted_insert(),
keymacro_get(), ed_command(), and EL_EDITMODE=0.
OK czarkoff@
|
|
I'm debugging the read module for weeks now,
but these ifdefs aren't helpful.
OK cpp(1).
|
|
Stop the read.c module from poking the el_chared.c_macro data
structure that used to belong to the chared.c module. Given that
no other module, not even chared itself, is using that data, move it
into the read modules's own opaque data structure, struct el_read_t.
That gets rid of one struct, one #define, one struct member, and one
function argument in the chared.h interface.
OK czarkoff@
|
|
Improve precision in the description of the "bind" builtin command.
Tweak terminology to better match editline(7).
|
|
return values.
|
|
document the return values, expand the list of affected functions, warn
against using EL_GETCFN, and clarify some wording and notation.
|
|
from the private header "read.h" to the public header <histedit.h>.
That's not an interface change, it was already used and documented
publicly, merely not properly declared.
Improve encapsulation: Make el_read a pointer to an opaque struct
in struct editline, such that "read.h" no longer needs to be included
from "el.h" but only from the two files using it, read.c and el.c.
Only pass the required el_read_t to el_read_{s,g}etfn(),
do not pass the full struct editline.
OK czarkoff@,
also proofread by Christian Heckendorf <mbie at ulmus dot me>.
|
|
Simplifies the build system and prevents modules
from stomping on each other's static symbols.
Based on a hint from guenther@,
using feedback from kettenis@ and deraadt@.
|
|
* The meaning of "next" and "previous" is exchanged in readline(3) with
respect to editline(3); this part of the patch from Bastian Maerkisch.
* next_history() can move beyond the newest entry; issue pointed out
by Bastian Maerkisch, fix by me.
While here, make the documentation of ed-next-history, ed-prev-history,
H_NEXT, and H_PREV more precise.
OK czarkoff@.
|
|
* Respect history_base.
* Bail out early for arguments that are too small.
* Select entry by readline offset, not by editline event number.
* Restore history cursor in case of failure.
This fixes the test_remove() regression test.
Based on a patch from Bastian Maerkisch <bmaerkisch at web dot de>.
Dmitrij Czarkoff pointed out a flaw in it that i fixed.
OK czarkoff@.
|
|
Based on a patch from Bastian Maerkisch <bmaerkisch at web dot de>,
with an additional fix for a memory leak by me.
OK czarkoff@
|
|
Return 0 for the oldest entry and increment by 1 for each newer,
non-deleted entry.
This fixes the test_where() regression test.
Patch from Bastian Maerkisch <bmaerkisch at web dot de>.
OK czarkoff@.
|
|
Patch from Bastian Maerkisch <bmaerkisch at web dot de>
with a minor tweak from Christos Zoulas.
Fixes the test_set_pos_return_values() regression test.
OK czarkoff@,
also proofread by zhuk@ and by Christian Heckendorf <mbie at ulmus dot me>.
|
|
|
|
included only in the one file needing it, "map.c".
That allows to define el_action_t directly in "map.h",
which in turn allows to stop including "fcns.h" from "el.h"
and include it only in the modules needing it.
Now we no longer autogenerate any C files.
Feedback and OK martijn@.
First version also proofread by Christian Heckendorf <mbie at ulmus dot me>.
|
|
and include it only in the one file needing it, map.c.
Also delete makelist -bc.
OK martijn@, also proofread by Christian Heckendorf <mbie at ulmus dot me>
|
|
constant and very short and simple. Check them into CVS rather
than generating them at build time in a complicated way.
OK martijn@, also proofread by Christian Heckendorf <mbie at ulmus dot me>
|
|
Otherwise, if you called ed-search-prev-history before doing any
history search but after entering at least one line into the history,
the buffer could get accessed uninitialized, potentially resulting
in a read buffer overrun.
Segfault reported in sftp(1) via djm@ by Alf Schlichting <A dot
Schlichting at lemarit dot com>, who also confirmed that the patch
fixes the issue for him.
OK martijn@ czarkoff@
|
|
ok martijn@
also checked by Christian Heckendorf <mbie at ulmus dot me>
|
|
in programs like ftp(1), sftp(1), bc(1), and cdio(1) that use libedit.
The existing editrc(5) manual only explains customization, and the
existing editline(3) manual only explains the C language interface.
Already listing all editor functions and all default key bindings, but
in other respects, not 100% complete yet, and due to the sheer size,
some bugs may have slipped, but all that can be fixed in the tree.
OK and tweaks jmc@.
Also seems reasonable to Christian Heckendorf <mbie at ulmus dot me>.
|
|
no functional change, minus hundred lines of code.
OK martijn@;
also proof-read by Christian Heckendorf <mbie at ulmus dot me>.
|
|
OpenBSD read.c rev. 1.4 1997/06/10 20:10:13 millert
FIONREAD takes int *, not long *
It got lost in the following merge from NetBSD:
OpenBSD read.c rev. 1.10 2003/10/31 08:42:24 otto
OK millert@ martijn@
|
|
* Make the return value from read_getcmd() less confusing.
* No need to store that return value; testing it once is enough.
* Get rid of one #ifdef section in el_wgets().
OK czarkoff@ martijn@
|
|
* Delete the unused macro MIN().
No functional change.
OK czarkoff@ martijn@
|
|
OK martijn@
|
|
* not used in tokenizer.c
* only use it for !NARROWCHAR
* no need for underscores before ct_{de,en}code_string()
* make the conversion buffer resize function private
OK martijn@
|
|
ok martijn@
|
|
FUNW, Strlen, Strdup, Strcmp, Strncmp, Strncpy, Strncat -> history.c
Strchr, tok_strdup -> tokenizer.c
FUN, TYPE, STR -> both of these files
OK martijn@
Also proofread by Christian Heckendorf <mbie at ulmus dot me>
who reported some whitespace issues in parse.c.
|
|
from Pedro Giffuni via Christos Zoulas.
|
|
longer needed now that we always compile with wide character support,
reducing code obfuscation.
OK czarkoff@ martijn@.
Diff also proofread by Christian Heckendorf <mbie at ulmus dot me>.
|
|
OK martijn@.
Diff also proofread by Christian Heckendorf <mbie at ulmus dot me>.
|
|
using libedit, using code from NetBSD tty.c rev. 1.42, 1.48, 1.49,
1.58, and 1.59. Code mostly by Christos Zoulas, one bug report by
John Hein, one additional bugfix by me (rev. 1.59).
While here, switch t_mode to unsigned char, which is sufficient,
also from NetBSD.
OK martijn@.
Also checked by Christian Heckendorf <mbie at ulmus dot me>.
|
|
No functional change.
ok guenther@
|
|
correctly - logically complete that now by removing MLINKS from base;
authors need only to ensure there is an entry in NAME for any function/
util being added. MLINKS will still work, and remain for perl to ease
upgrades;
ok nicm (curses) bcook (ssl)
ok schwarze, who provided a lot of feedback and assistance
ok tb natano jung
|
|
committing right away because this code is not even compiled by default
|
|
OK schwarze@
|
|
bug reported by David Binderman
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50880
fix suggested by me, NetBSD rev. 1.23 and rev. 1.24.
|
|
NetBSD chartype.c rev. 1.23, chartype.h rev. 1.25, eln.c rev. 1.28.
No code change.
|
|
While here, also use \-1 rather than -1; not sure that's really
better, but Thomas is right it should at least be consistent
within a page.
From Thomas Klausner <wiz @ NetBSD>.
|
|
OK czarkoff@
|
|
On first sight, it might look as if this required a bump because
it seems to change the public type el_rfunc_t. But we only compile
with WIDECHAR, and in that case, there is no change in the interface.
This also simplifies some logic by getting rid of the NARROW_READ flag
which was broken anyway.
OK czarkoff@
|
|
Always use el_wgetc(3) internally. In the !WIDECHAR case, casting
the result to (Char) is safe because the function returns a byte
rather than a character in that case.
No functional change except for fixing a printf(3) format string issue
when compiled with DEBUG_READ and WIDECHAR.
OK czarkoff@
|
|
NetBSD rev. 1.68 2012/09/10 christos (bugfixes from Steffen Nurpmeso)
* el_wgetc(): set el_errno after read_char() failure
* el_wgets(): flag error condition after read_getcmd() failure
NetBSD rev. 1.69 2012/09/11 christos (bugfix from Christos Zoulas)
* read_getcmd(): return failure after el_wgetc() failure
NetBSD rev. 1.75 2016/02/12 christos (cleanup from Christos Zoulas)
* read_getcmd(): use a constant rather than a magical number
|
|
1. Add the missing <errno.h> to sig.c.
2. Do not include standard headers from private headers "chared.h"
and "el.h", include them directly where needed.
3. Delete a few needless inclusions of <ctype.h>.
4. Sort the standard headers.
5. Delete _GNU_SOURCE weirdness from histedit.h, that file doesn't even
need the access to wcsdup(3) mentioned in the comment.
6. Delete some trailing blanks and blanks before tabs.
OK czarkoff@
|
|
OK czarkoff@
|
|
1. Do not include private headers from "chared.h", "hist.h", "prompt.h",
"refresh.h", "search.h", "sig.h", "terminal.h", "tty.h".
The only private header having to include other private headers is "el.h".
2. Do not include "common.h", "parse.h", "help.h" from "el.h",
and do not include "emacs.h" and "vi.h" from "chared.h",
include them directly where needed.
3. Do include "fcns.h" from "el.h" because el_func_t is needed for "map.h".
4. Do not include private headers again that are already included by "el.h".
5. Include private headers after standard headers.
OK czarkoff@
|
|
OK czarkoff@
|