OpenBSD CVS

CVS log for src/lib/libedit/readline.c


[BACK] Up to [local] / src / lib / libedit

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.30 / (download) - annotate - [select for diffs], Wed Mar 8 04:43:05 2023 UTC (15 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.29: +1 -17 lines
Diff to previous 1.29 (colored)

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@

Revision 1.29 / (download) - annotate - [select for diffs], Wed Aug 14 08:31:00 2019 UTC (4 years, 9 months ago) by asou
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

read() returns -1 on failure

ok yasuoka@

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:42 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.27 / (download) - annotate - [select for diffs], Tue May 31 16:12:00 2016 UTC (8 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Fix a crash in stifle_history() that occurred when the history
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).

Revision 1.26 / (download) - annotate - [select for diffs], Tue May 10 11:07:53 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.25: +26 -4 lines
Diff to previous 1.25 (colored)

Fix next_history() and previous_history():
* 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@.

Revision 1.25 / (download) - annotate - [select for diffs], Tue May 10 10:49:37 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.24: +20 -8 lines
Diff to previous 1.24 (colored)

Fix history_get():
* 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@.

Revision 1.24 / (download) - annotate - [select for diffs], Mon May 9 12:31:55 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.23: +14 -2 lines
Diff to previous 1.23 (colored)

Fix stifle_history(): Remove excessive entries, if any.
Based on a patch from Bastian Maerkisch <bmaerkisch at web dot de>,
with an additional fix for a memory leak by me.
OK czarkoff@

Revision 1.23 / (download) - annotate - [select for diffs], Sun May 8 13:52:33 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.22: +7 -4 lines
Diff to previous 1.22 (colored)

Change where_history() to agree with the GNU implementation:
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@.

Revision 1.22 / (download) - annotate - [select for diffs], Sun May 8 13:34:35 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.21: +5 -5 lines
Diff to previous 1.21 (colored)

Make the history_set_pos() return values agree with the GNU implementation.
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>.

Revision 1.21 / (download) - annotate - [select for diffs], Fri May 6 13:12:52 2016 UTC (8 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

Replace the generated file "fcns.c" by a simpler header "func.h"
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>.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Apr 9 19:31:55 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +1 -3 lines
Diff to previous 1.19 (colored)

Always compile with WIDECHAR on and delete that preprocessor switch.
OK martijn@.
Diff also proofread by Christian Heckendorf <mbie at ulmus dot me>.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Mar 21 17:28:10 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.18: +13 -10 lines
Diff to previous 1.18 (colored)

Make the read_char() function always take a wchar_t * argument.

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@

Revision 1.18 / (download) - annotate - [select for diffs], Sun Mar 20 23:48:27 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +15 -15 lines
Diff to previous 1.17 (colored)

Cleanup of standard header inclusion:

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@

Revision 1.17 / (download) - annotate - [select for diffs], Sun Mar 20 22:57:59 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.16: +2 -4 lines
Diff to previous 1.16 (colored)

Cleanup of private header inclusion:

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@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Mar 20 00:01:21 2016 UTC (8 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])
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@

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jan 30 12:22:20 2016 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.14: +72 -72 lines
Diff to previous 1.14 (colored)

Fourth step in synching with NetBSD:
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@

Revision 1.14 / (download) - annotate - [select for diffs], Fri Feb 6 23:21:58 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored)

SIZE_MAX is standard, we should be using it in preference to the
obsolete SIZE_T_MAX.  OK miod@ beck@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jan 13 08:33:12 2015 UTC (9 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.12: +8 -1 lines
Diff to previous 1.12 (colored)

libedit claims compatibility with readline 4.2, so provide a stub for
rl_set_keyboard_input_timeout() that was added in this version.
Also crank the minor version.

OK krw@ yasuoka@ deraadt@

Revision 1.12 / (download) - annotate - [select for diffs], Wed Oct 15 10:55:11 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +6 -5 lines
Diff to previous 1.11 (colored)

use reallocarray()

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 11 04:24:06 2014 UTC (9 years, 8 months ago) by doug
Branch: MAIN
Changes since 1.10: +4 -3 lines
Diff to previous 1.10 (colored)

Userland reallocarray() audit.

Avoid potential integer overflow in the size argument of malloc() and
realloc() by using reallocarray() to avoid unchecked multiplication.

ok deraadt@

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 8 05:41:11 2011 UTC (12 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.9: +5 -5 lines
Diff to previous 1.9 (colored)

el_set EL_BIND or EL_SETTC must have argument lists ending with NULL.

ok tedu

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 7 05:40:42 2011 UTC (12 years, 11 months ago) by okan
Branch: MAIN
Changes since 1.8: +103 -95 lines
Diff to previous 1.8 (colored)

sync with upstream, retaining local modifications.

ok nicm@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jun 30 00:05:35 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.7: +710 -592 lines
Diff to previous 1.7 (colored)

Update libedit to bring it into sync with the latest version from NetBSD.

ok deraadt

Revision 1.7 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:28 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.6: +1 -4 lines
Diff to previous 1.6 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jun 21 00:38:22 2009 UTC (14 years, 11 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

fix rcs ids.  ok sthen@

Revision 1.5 / (download) - annotate - [select for diffs], Sun Nov 9 12:34:46 2008 UTC (15 years, 7 months ago) by tobias
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

typo fixed (overriden -> overridden)

ok espie, jmc

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 26 05:42:05 2008 UTC (15 years, 11 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.3: +1 -8 lines
Diff to previous 1.3 (colored)

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Nov 14 13:36:37 2005 UTC (18 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.2: +2 -5 lines
Diff to previous 1.2 (colored)

use asprintf()

Revision 1.2 / (download) - annotate - [select for diffs], Tue Nov 25 20:12:38 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.1: +607 -384 lines
Diff to previous 1.1 (colored)

Sync libedit to NetBSD libedit as of Nov 8, 2003.
Tested by jmc@ djm@ and myself

Revision 1.1 / (download) - annotate - [select for diffs], Fri Oct 31 08:42:24 2003 UTC (20 years, 7 months ago) by otto
Branch: MAIN

Update to NetBSD libedit (from Oct 1, 2003), adding some string
cleaning and history bug fixes. The code includes GNU libreadline
functionality, but the corresponding header files are not installed,
since some libreadline functions are missing. There are some minor API
changes, notably:

old: EditLine *el_init(const char *, FILE *, FILE *);
new: EditLine *el_init(const char *, FILE *, FILE *, FILE *);

old: HistEvent *history(History *h, int op, ...);
new: int history(History *h, HistEvent *ev, int op, ...); plus some
changes in operation names. See editline(3) for details.

Tested by djm@, mouring@, jmc@.

ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.