HomeFreeBSD

MFC r352136, r352204, r352275, r352341

Description

MFC r352136, r352204, r352275, r352341

r352136:
Import libedit 2019-09-10

Compared to current version in base:

  • great improvements on the Unicode support
  • full support for filename completion including quoting which means we do not need anymore our custom addition)
  • Improved readline compatiblity

Upgrading libedit has been a pain in the past, because somehow we never
managed to properly cleanup the tree in lib/libedit and each merge has always
been very painful. After years of fighting give up and refresh a merge from
scrarch properly in contrib.

Note that the switch to this version will be done in another commit.

r352204:
Readd _el_fn_sh_complete for backward compatibility

This function is not needed anymore, it allows old sh binary to continue
to run and avoid breaking backward compatibility.
Note that is now just calls the regular _el_fn_complete which does a proper
job at quoting.

Discussed with: jilles

r352275:
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>
Differential Revision: https://reviews.freebsd.org/D21584

r352341:
Fix arm and aarch64 builds of libedit after r352275

On arm and arm64, where chars are unsigned by default, buildworld dies
with:

  • terminal.o ---

/usr/src/contrib/libedit/terminal.c:569:41: error: comparison of
integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka
'unsigned int') [-Werror,-Wsign-compare]

el->el_cursor.v][where & 0370] !=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

/usr/src/contrib/libedit/terminal.c:659:28: error: comparison of
integers of different signs: 'wint_t' (aka 'int') and 'wchar_t' (aka
'unsigned int') [-Werror,-Wsign-compare]

[el->el_cursor.h] == MB_FILL_CHAR)
~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~

Fix this by making MB_FILL_CHAR a wint_t, so no casting is needed.

Note that in https://reviews.freebsd.org/D21584 this was also proposed
by Yuichiro Naito <naito.yuichiro_gmail.com>.

Reviewed by: bapt
Subscribers: naito.yuichiro_gmail.com, ml_vishwin.info
X-MFC-With: r352275
Differential Revision: https://reviews.freebsd.org/D21657

Details

Provenance
baptAuthored on
Reviewer
bapt
Differential Revision
D21584: Update libedit to 2019-09-10
Parents
rS358112: MFC r352242, r352249
Branches
Unknown
Tags
Unknown