Commit Graph

213 Commits

Author SHA1 Message Date
Baptiste Daroussin
8156570000 Update libedit to a snapshot from 2019-09-10
This version bring many fixes regarding unicode support
It also adds proper support for filename completion (we do not need our custom
patches anymore)
Improves the libreadline compatibility

Note that the same work was done by Yuichiro Naito in
https://reviews.freebsd.org/D21196 the main difference is in this case we have
reimported libedit in contrib to fix a long standing mess in the previous merges
which prevented a proper update workflow. (discussed long ago with pfg@)

The only difference with upstream libedit is we have added a compatibility shim
for the _elf_fn_sh_complete function which we previously added to support quoting
in filename completion and is not needed anymore.
This was added to continue supported old /bin/sh binaries and not break backward
compatibility (as discussed with jilles@)

Reviewed by:	Yuichiro Naito <naito.yuichiro_gmail.com>
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D21584
2019-09-13 06:50:02 +00:00
Jilles Tjoelker
fbdcf603c8 libedit: Avoid out of bounds read in 'bind' command
This is CVS revision 1.31 from NetBSD lib/libedit/chartype.c:
Make sure that argv is NULL terminated since functions like tty_stty rely
on it to be so (Gerry Swinslow)

This broke when the wide-character support was enabled in libedit. The
conversion from multibyte to wide-character did not supply the apparently
expected terminating NULL in the new argv array.

PR:		233343
Submitted by:	Yuichiro NAITO
Obtained from:	NetBSD
MFC after:	1 week
2019-01-16 21:59:18 +00:00
Baptiste Daroussin
6bbd1d19fd libedit: improve multibyte support
Until this commit libedit only supported UTF-8 for multibyte charset
Improve it to support other multibyte charsets

Tested with eucJP and SJIS charsets.
Note that this change as been review and committed in upstream libedit
as well via christos@NetBSD

Submitted by:	naito.yuichiro _at_ gmail.com
Reviewed by:	bapt, pfg, yuripv, 0mp
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D17903
2018-11-26 08:16:33 +00:00
Pedro F. Giffuni
6ea268b652 libedit: sort the Makefile in line with NetBSD's version.
NetBSD's libedit has been been cleaned-up considerably so the
non--widecharacter version is no longer an option. Re -sorting the
Makefile should make it easier for some brave soul trying to update it.

No functional change intended.

MFC after:	5 days
2018-01-29 22:38:23 +00:00
Eitan Adler
d52a982ea8 lib: Fix several typos and minor errors
- duplicate words
- typos
- references to old versions of FreeBSD

Reviewed by:	imp, benno
2017-12-27 03:23:41 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Pedro F. Giffuni
98fa04efed libedit: raise the warning level to 3.
NetBSD has the warning level to 5 but that actually triggers -Wcast-qual.
2017-09-14 19:50:07 +00:00
Pedro F. Giffuni
cf7df9f141 libedit: add missing bracket.
We never hit this because we always build with widechar support.

Reported by:	cognet
MFC after:	3 days
2017-09-13 16:13:14 +00:00
Conrad Meyer
bb4877783c editline.3: Add missing argument to H_SET description
The H_SET operation of the history() function takes an int argument which is
the position of the item to which the cursor should be moved to.

Submitted by:	Abhinav Upadhyay <abhinav@NetBSD.org>
2017-04-28 21:05:28 +00:00
Pedro F. Giffuni
678bbc14b2 MFV 312999:
Update libedit 2016-03-21

Minor cleanups plus some license syncing.

Obtained from:	NetBSD
X-MFC with:	r312997
2017-01-30 23:00:51 +00:00
Pedro F. Giffuni
450aba5b34 MFV r312996:
Re-import libedit 2016-02-27

This reverts r296435: the issues related to lldb and this update appear to
have been identified (in lldb).

Obtained from:	NetBSD
Reported by:	emaste
MFC after:	3 weeks
2017-01-30 22:11:53 +00:00
Marcel Moolenaar
2b4da8aa20 When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

See also r305855

MFC after:	1 month
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7906
2016-09-24 15:11:27 +00:00
Pedro F. Giffuni
75f46cf6c8 lib: minor spelling fixes in comments.
No functional change.
2016-05-01 19:37:33 +00:00
Glen Barber
876d357fa7 MFH
Sponsored by:	The FreeBSD Foundation
2016-04-11 15:24:59 +00:00
Pedro F. Giffuni
14eaf4448c libedit: replace 0 with NULL for pointers.
Found with devel/coccinelle.

Reviewed by:	Christos Zoulas
2016-04-09 18:52:09 +00:00
Glen Barber
7e2d468315 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-07 15:44:54 +00:00
Pedro F. Giffuni
1f37f0f18f Revert r296175
Undo update of libedit 2016-02-27

Something in libedit appears to be causing breakage in lldb38.
The changes are not generally huge but they are suficient to
to justify reverting for now.

Reported by:	novel, bapt
2016-03-06 21:32:54 +00:00
Glen Barber
52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Pedro F. Giffuni
e81f248547 MFV r296159
Sync our libedit with NetBSD's libedit 2016-02-27.

Obtained from:	NetBSD
2016-02-29 00:15:25 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber
bbb51924bb MFH
Sponsored by:	The FreeBSD Foundation
2016-02-08 12:16:01 +00:00
Pedro F. Giffuni
56f42903b1 MFV r295360
Sync our libedit with NetBSD's libedit 2016-01-16

Obtained from:	NetBSD
2016-02-07 15:26:21 +00:00
Glen Barber
c389411c8a Remove libc, librtld_db, libthr packages, and further increase
the constraints on what needs to be installed in a specific to
maintain consistency during upgrades.

Create a new clibs package containing libraries that are needed
as a bare minimum for consistency.

With much help and input from:	kib
Sponsored by:	The FreeBSD Foundation
2016-02-05 21:01:08 +00:00
Glen Barber
a70cba9582 First pass through library packaging.
Sponsored by:	The FreeBSD Foundation
2016-02-04 21:16:35 +00:00
Bryan Drewery
7b3ea376a2 META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.
This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:10:28 +00:00
Brooks Davis
ff849914ef Revert r290298. Per discussion on tech-userlevel@netbsd.org this change
was incorrect.
2015-11-05 17:00:38 +00:00
Brooks Davis
942505ca1c The ops EL_SIGNAL, EL_EDITMODE, EL_UNBUFFERED, and EL_PREP_TERM all take
an int, not an int*.

Sponsored by:	DARPA, AFRL
Discovered with:	CHERI
Differential Revision:	https://reviews.freebsd.org/D4071
2015-11-02 22:21:02 +00:00
Jilles Tjoelker
f1d04a2543 libedit: Use correct buffer lengths in vi mode v command.
Libedit's vi mode provides a v command to edit the current line in vi(1)
(hard-coded to vi, in fact).

When Unicode/wide character mode was added, this command started truncating
and/or corrupting the edited text.

This commit fixes v if the text fits into the buffer. If the text is longer,
it is truncated.

PR:		203743
Obtained from:	NetBSD (originally submitted by me)
2015-10-27 21:16:29 +00:00
Baptiste Daroussin
18b2ee82db Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
Baptiste Daroussin
4232f82668 Enforce overwritting SHLIBDIR
Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by:	many
2015-06-15 15:34:20 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Baptiste Daroussin
9c95743246 Sync with NetBSD:
- fix types of rl_completion_entry_function and rl_add_defun
- call update pos before completion to refresh the screen
From Thomas Eriksson

Adjust API to a more modern readline (Ryo Onodera)

remove duplicate declaration
2015-06-07 10:01:59 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
d44bc1335e Synchronize libedit with NetBSD
It incorporates and fixes our patches to get el_gets return the proper count of
characters in unicode mode.
2015-05-18 22:03:05 +00:00
Baptiste Daroussin
b5ed0fe321 Do not modify locales 2015-04-26 09:25:44 +00:00
Baptiste Daroussin
0f638f5385 revert r278414
Reported by:	bz
2015-02-08 23:03:41 +00:00
Baptiste Daroussin
6062b7ccd9 Reapply r255891 2015-02-08 22:24:18 +00:00
Baptiste Daroussin
7c5c8a589b Remove junk added during testing phase 2015-01-09 07:48:22 +00:00
Baptiste Daroussin
c1a66a97f9 Synchronize libedit with NetBSD and activate UTF-8 support [1]
Differences with NetBSD
Reapply our local patches on top of it
Fix Unicode environement detection
Fix reading a line in unicode environment.
It allows /bin/sh to works in UTF-8 envs

Differential Revision:	https://reviews.freebsd.org/D1455
Reviewed by:	jilles, pfg
Obtained from:	NetBSD [1]
MFC after:	1 month
Relnotes:	yes
2015-01-09 07:40:56 +00:00
Baptiste Daroussin
6b129086dc Convert libraries to use LIBADD
While here reduce a bit overlinking
2014-11-25 11:07:26 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Pedro F. Giffuni
abcd8f4535 Fix mismatch.
MFC after:	3 days
2014-07-23 15:12:17 +00:00
Brooks Davis
80189b3b09 Replace all uses of libncurses and libtermcap with their wide character
variants.  This allows usable file system images (i.e. those with both a
shell and an editor) to be created with only one copy of the curses library.

Exp-run:	antoine
PR:		189842
Discussed with:	bapt
Sponsored by:	DARPA, AFRL
2014-07-17 18:24:34 +00:00
Pedro F. Giffuni
c4a1f025cf Sync some (mostly cosmetical) changes from NetBSD
Makefile,v 1.37
tc1.c v 1.3
Rename TEST/test.c tc1.c

common.c,v 1.23
pass lint on _LP64.

emacs.c,v 1.22
pass lint on _LP64.

filecomplete.h,v 1.8
mv NetBSD ID back from 1.9 as we don't
have the widecharacter support.

prompt.c,v 1.14
prompt.h,v 1.9
term.h,v 1.20
read.h,v 1.6
Update NetBSD version strings

sys.h,v 1.12
Misc sun stuff.

tty.c 1.31
handle EINTR in the termios operations
Allow a single process to control multiple ttys (for pthreads using _REENTRANT)
using multiple EditLine objects.
pass lint on _LP64.
Don't depend on side effects inside an assert

MFC after:	1 week
Obtained from:	NetBSD
2014-07-10 17:52:17 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Eitan Adler
8be8ad916f libedit: add H_SAVE_FP which saves history to a file pointer.
H_SAVE_FP is similar to H_SAVE but operates on a FILE* instead of a filename.
This is useful when operating in capability mode.

Reviewed by:	christos@NetBSD.org, pfg
2014-05-11 01:44:11 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
9d2ab4a62d Merge head 2014-04-27 08:13:43 +00:00
Ed Maste
0fcefb433d Update NetBSD Foundation copyrights to 2-clause BSD
The NetBSD Foundation states "Third parties are encouraged to change the
license on any files which have a 4-clause license contributed to the
NetBSD Foundation to a 2-clause license."

This change removes clauses 3 and 4 from copyright / license blocks that
list The NetBSD Foundation as the only copyright holder.

Sponsored by:	The FreeBSD Foundation
2014-03-18 01:40:25 +00:00