Projects
openEuler:Mainline
libedit
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
_service:tar_scm:libedit.spec
Changed
@@ -1,8 +1,8 @@ -%global _date 20210910 +%global _date 20221030 Name: libedit Version: 3.1 -Release: 29 +Release: 30 Summary: The NetBSD Editline library License: BSD URL: http://www.thrysoee.dk/editline/ @@ -69,6 +69,12 @@ %exclude %{_mandir}/man3/history.3* %changelog +* Fri Aug 4 2023 dillon chen<dillon.chen@gmail.com> - 3.1-30 +- Type:enhancement +- ID: NA +- SUG: NA +- DESC:update version to 20221030 + * Tue Oct 25 2022 yanglongkang<yanglongkang@h-partners.com> - 3.1-29 - Type: bugfix - ID: NA
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/ChangeLog -> _service:tar_scm:libedit-20221030-3.1.tar.gz/ChangeLog
Changed
@@ -1,6 +1,21 @@ * See also NetBSD changelog: http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit +2022-10-30 Jess Thrysoee + + * src/sys.h, src/reallocarr.c: Remove unused sys/cdefs.h include, to compile against musl libc + Reported by Matt Boehlke + + * version-info: 0:70:0 + +2022-10-09 Jess Thrysoee + + * version-info: 0:69:0 + + * src/sys.h: Add __sun guard around sys/types.h in sys.h + + * all: sync with upstream source + 2021-09-10 Jess Thrysoee * all: sync with upstream source
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/Makefile.in -> _service:tar_scm:libedit-20221030-3.1.tar.gz/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -189,8 +189,7 @@ DIST_SUBDIRS = src examples doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/libedit.pc.in COPYING ChangeLog INSTALL THANKS \ - compile config.guess config.sub depcomp install-sh ltmain.sh \ - missing + compile config.guess config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -263,6 +262,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/acinclude.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/acinclude.m4
Changed
@@ -39,11 +39,12 @@ # The prototype for the POSIX version is: # int getpwnam_r(char *, struct passwd *, char *, size_t, struct passwd **) # int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); - AC_TRY_LINK(#include <stdlib.h> + AC_LINK_IFELSE( + AC_LANG_PROGRAM(#include <stdlib.h> #include <sys/types.h> - #include <pwd.h>, - getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL); - getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);, + #include <pwd.h>, + getpwnam_r(NULL, NULL, NULL, (size_t)0, NULL); + getpwuid_r((uid_t)0, NULL, NULL, (size_t)0, NULL);), AC_DEFINE(HAVE_GETPW_R_POSIX, 1, Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1 compatible.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) @@ -55,11 +56,12 @@ # The prototype for the POSIX draft version is: # struct passwd *getpwuid_r(uid_t, struct passwd *, char *, int); # struct passwd *getpwnam_r(char *, struct passwd *, char *, int); - AC_TRY_LINK(#include <stdlib.h> + AC_LINK_IFELSE( + AC_LANG_PROGRAM(#include <stdlib.h> #include <sys/types.h> - #include <pwd.h>, - getpwnam_r(NULL, NULL, NULL, (size_t)0); - getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);, + #include <pwd.h>, + getpwnam_r(NULL, NULL, NULL, (size_t)0); + getpwuid_r((uid_t)0, NULL, NULL, (size_t)0);), AC_DEFINE(HAVE_GETPW_R_DRAFT, 1, Define to 1 if you have getpwnam_r and getpwuid_r that are draft POSIX.1 versions.) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/aclocal.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/aclocal.m4
Changed
@@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.16.4 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. @@ -35,7 +35,7 @@ am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.16.4, , +m4_if($1, 1.16.5, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -51,7 +51,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.16.4)dnl +AM_AUTOMAKE_VERSION(1.16.5)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) @@ -428,6 +428,10 @@ # release and drop the old call support. AC_DEFUN(AM_INIT_AUTOMAKE, AC_PREREQ(2.65)dnl +m4_ifdef(_$0_ALREADY_INIT, + m4_fatal($0 expanded multiple times +m4_defn(_$0_ALREADY_INIT)), + m4_define(_$0_ALREADY_INIT, m4_expansion_stack))dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow(^AM_A-Z+FLAGS$)dnl
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/config.h.in -> _service:tar_scm:libedit-20221030-3.1.tar.gz/config.h.in
Changed
@@ -72,6 +72,9 @@ /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the `reallocarr' function. */ +#undef HAVE_REALLOCARR + /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP @@ -229,9 +232,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/config.sub -> _service:tar_scm:libedit-20221030-3.1.tar.gz/config.sub
Changed
@@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2021-07-03' +timestamp='2021-08-14' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -121,9 +121,11 @@ # Split fields of configuration type # shellcheck disable=SC2162 +saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <<EOF $1 EOF +IFS=$saved_IFS # Separate into logical components for further validation case $1 in @@ -172,6 +174,10 @@ basic_machine=$field1 basic_os=$field2 ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun234* \ @@ -931,9 +937,11 @@ *-*) # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read cpu vendor <<EOF $basic_machine EOF + IFS=$saved_IFS ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -1313,9 +1321,11 @@ ;; *-*) # shellcheck disable=SC2162 + saved_IFS=$IFS IFS="-" read kernel os <<EOF $basic_os EOF + IFS=$saved_IFS ;; # Default OS when just kernel was specified nto*) @@ -1697,7 +1707,7 @@ # Now, validate our (potentially fixed-up) OS. case $os in # Sometimes we do "kernel-libc", so those need to count as OSes. - musl* | newlib* | uclibc*) + musl* | newlib* | relibc* | uclibc*) ;; # Likewise for "kernel-abi" eabi* | gnueabi*) @@ -1738,7 +1748,7 @@ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ - | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v4-9* | sco5v6*) @@ -1755,11 +1765,12 @@ # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; - -dietlibc* | -newlib* | -musl* | -uclibc* ) + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/configure -> _service:tar_scm:libedit-20221030-3.1.tar.gz/configure
Changed
@@ -617,7 +617,7 @@ # Identity of this package. PACKAGE_NAME='libedit' -PACKAGE_TARNAME='libedit-20210910' +PACKAGE_TARNAME='libedit-20221030' PACKAGE_VERSION='3.1' PACKAGE_STRING='libedit 3.1' PACKAGE_BUGREPORT='' @@ -689,6 +689,7 @@ AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -1417,7 +1418,7 @@ --localedir=DIR locale-dependent data DATAROOTDIR/locale --mandir=DIR man documentation DATAROOTDIR/man --docdir=DIR documentation root - DATAROOTDIR/doc/libedit-20210910 + DATAROOTDIR/doc/libedit-20221030 --htmldir=DIR html documentation DOCDIR --dvidir=DIR dvi documentation DOCDIR --pdfdir=DIR pdf documentation DOCDIR @@ -4539,7 +4540,7 @@ # Define the identity of the package. - PACKAGE='libedit-20210910' + PACKAGE='libedit-20221030' VERSION='3.1' @@ -4780,8 +4781,8 @@ -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -5409,13 +5410,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5553,7 +5554,7 @@ fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5657,7 +5658,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5700,7 +5701,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.* //'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.* //'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5906,6 +5907,114 @@ if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + +
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/configure.ac -> _service:tar_scm:libedit-20221030-3.1.tar.gz/configure.ac
Changed
@@ -23,25 +23,24 @@ # "./configure --disable-silent-rules" or "make V=1" # -AC_INIT(libedit, EL_RELEASE,, libedit-EL_TIMESTAMP) +AC_INIT(libedit,EL_RELEASE,,libedit-EL_TIMESTAMP) AC_CONFIG_MACRO_DIR(m4) AC_CONFIG_SRCDIR(src/strlcat.c) -AC_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS(config.h) # features of Posix that are extensions to C (define _GNU_SOURCE) AC_USE_SYSTEM_EXTENSIONS AM_INIT_AUTOMAKE -AC_PROG_LIBTOOL +LT_INIT # libtool -version-info -AC_SUBST(LT_VERSION, 0:68:0) +AC_SUBST(LT_VERSION, 0:70:0) m4_ifdef(AM_SILENT_RULES, AM_SILENT_RULES(yes)) # Checks for programs. -AC_PROG_CC_C99 -#AC_PROG_CC +AC_PROG_CC AC_PROG_LN_S AC_PROG_AWK EL_MANTYPE @@ -70,7 +69,9 @@ # Checks for header files. AC_HEADER_DIRENT -AC_HEADER_STDC +AC_CHECK_INCLUDES_DEFAULT +AC_PROG_EGREP + AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h termcap.h) @@ -117,9 +118,8 @@ ## _AIX is offended by rpl_malloc and rpl_realloc #AC_FUNC_MALLOC #AC_FUNC_REALLOC -AC_TYPE_SIGNAL AC_FUNC_STAT -AC_CHECK_FUNCS(endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strcspn strdup strerror strrchr strstr strtol issetugid wcsdup strlcpy strlcat vis strvis strunvis __secure_getenv secure_getenv) +AC_CHECK_FUNCS(endpwent isascii memchr memset re_comp regcomp strcasecmp strchr strcspn strdup strerror strrchr strstr strtol issetugid wcsdup strlcpy strlcat vis strvis strunvis __secure_getenv secure_getenv reallocarr) # strlcpy AC_CHECK_FUNC(strlcpy, found_strlcpy=yes, found_strlcpy=no)
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/doc/Makefile.in -> _service:tar_scm:libedit-20221030-3.1.tar.gz/doc/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -183,6 +183,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/examples/Makefile.in -> _service:tar_scm:libedit-20221030-3.1.tar.gz/examples/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -209,6 +209,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/ltmain.sh -> _service:tar_scm:libedit-20221030-3.1.tar.gz/ltmain.sh
Changed
@@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# <https://opensource.org/license/MIT>, and GPL version 2 or later +# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# <https://github.com/gnulib-modules/bootstrap/issues> ## ------ ## @@ -139,9 +130,12 @@ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ s/\\(^$_G_bs\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ } -# func_quote_for_eval ARG...
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/m4/libtool.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/m4/libtool.m4
Changed
@@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. ) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require(_LT_CHECK_SHELL_FEATURES)dnl m4_require(_LT_PATH_CONVERSION_FUNCTIONS)dnl m4_require(_LT_CMD_RELOAD)dnl +m4_require(_LT_DECL_FILECMD)dnl m4_require(_LT_CHECK_MAGIC_METHOD)dnl m4_require(_LT_CHECK_SHAREDLIB_FROM_LINKLIB)dnl m4_require(_LT_CMD_OLD_ARCHIVE)dnl @@ -219,8 +221,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1068,11 +1070,11 @@ darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) - case ${MACOSX_DEPLOYMENT_TARGET},$host in - 10.012,*|,*powerpc*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - *) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.012,*|,*powerpc*-darwin5-8*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1121,12 +1123,12 @@ output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if($1, CXX, if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ,) else @@ -1240,7 +1242,8 @@ # _LT_WITH_SYSROOT # ---------------- AC_DEFUN(_LT_WITH_SYSROOT, -AC_MSG_CHECKING(for sysroot) +m4_require(_LT_DECL_SED)dnl +AC_MSG_CHECKING(for sysroot) AC_ARG_WITH(sysroot, AS_HELP_STRING(--with-sysroot@<:@=DIR@:>@, Search for dependent libraries within DIR (or the compiler's sysroot @@ -1257,7 +1260,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1287,7 +1290,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1304,7 +1307,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1316,7 +1319,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1338,7 +1341,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1346,7 +1349,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1354,7 +1357,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1374,14 +1377,14 @@ # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1449,7 +1452,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1488,9 +1491,22 @@ m4_defun(_LT_PROG_AR, AC_CHECK_TOOLS(AR, ar, false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL(, AR, 1, The archiver) -_LT_DECL(, AR_FLAGS, 1, Flags to create an archive) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/m4/ltoptions.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/m4/ltoptions.m4
Changed
@@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/m4/ltsugar.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/m4/ltsugar.m4
Changed
@@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 #
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/m4/ltversion.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/m4/ltversion.m4
Changed
@@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define(LT_PACKAGE_VERSION, 2.4.6) -m4_define(LT_PACKAGE_REVISION, 2.4.6) +m4_define(LT_PACKAGE_VERSION, 2.4.7) +m4_define(LT_PACKAGE_REVISION, 2.4.7) AC_DEFUN(LTVERSION_VERSION, -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, Which release of libtool.m4 was used?) _LT_DECL(, macro_revision, 0) )
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/m4/lt~obsolete.m4 -> _service:tar_scm:libedit-20221030-3.1.tar.gz/m4/lt~obsolete.m4
Changed
@@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/Makefile.am -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/Makefile.am
Changed
@@ -27,7 +27,7 @@ lib_LTLIBRARIES = libedit.la libedit_la_SOURCES = chared.c common.c el.c eln.c emacs.c hist.c keymacro.c map.c chartype.c parse.c \ prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c \ - wcsdup.c \ + reallocarr.c wcsdup.c \ tokenizer.c tokenizern.c \ history.c historyn.c \ filecomplete.c readline.c chared.h literal.c el.h hist.h \
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/Makefile.in -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.4 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. @@ -140,13 +140,13 @@ libedit_la_LIBADD = am__libedit_la_SOURCES_DIST = chared.c common.c el.c eln.c emacs.c \ hist.c keymacro.c map.c chartype.c parse.c prompt.c read.c \ - refresh.c search.c sig.c terminal.c tty.c vi.c wcsdup.c \ - tokenizer.c tokenizern.c history.c historyn.c filecomplete.c \ - readline.c chared.h literal.c el.h hist.h histedit.h \ - keymacro.h map.h chartype.h parse.h prompt.h read.h refresh.h \ - search.h sig.h sys.h terminal.h tty.h vis.h filecomplete.h \ - editline/readline.h literal.h strlcpy.c strlcat.c getline.c \ - vis.c unvis.c + refresh.c search.c sig.c terminal.c tty.c vi.c reallocarr.c \ + wcsdup.c tokenizer.c tokenizern.c history.c historyn.c \ + filecomplete.c readline.c chared.h literal.c el.h hist.h \ + histedit.h keymacro.h map.h chartype.h parse.h prompt.h read.h \ + refresh.h search.h sig.h sys.h terminal.h tty.h vis.h \ + filecomplete.h editline/readline.h literal.h strlcpy.c \ + strlcat.c getline.c vis.c unvis.c @HAVE_STRLCPY_FALSE@am__objects_1 = strlcpy.lo @HAVE_STRLCAT_FALSE@am__objects_2 = strlcat.lo @HAVE_GETLINE_FALSE@am__objects_3 = getline.lo @@ -155,10 +155,10 @@ am_libedit_la_OBJECTS = chared.lo common.lo el.lo eln.lo emacs.lo \ hist.lo keymacro.lo map.lo chartype.lo parse.lo prompt.lo \ read.lo refresh.lo search.lo sig.lo terminal.lo tty.lo vi.lo \ - wcsdup.lo tokenizer.lo tokenizern.lo history.lo historyn.lo \ - filecomplete.lo readline.lo literal.lo $(am__objects_1) \ - $(am__objects_2) $(am__objects_3) $(am__objects_4) \ - $(am__objects_5) + reallocarr.lo wcsdup.lo tokenizer.lo tokenizern.lo history.lo \ + historyn.lo filecomplete.lo readline.lo literal.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) am__objects_6 = nodist_libedit_la_OBJECTS = $(am__objects_6) libedit_la_OBJECTS = $(am_libedit_la_OBJECTS) \ @@ -193,13 +193,13 @@ ./$(DEPDIR)/keymacro.Plo ./$(DEPDIR)/literal.Plo \ ./$(DEPDIR)/map.Plo ./$(DEPDIR)/parse.Plo \ ./$(DEPDIR)/prompt.Plo ./$(DEPDIR)/read.Plo \ - ./$(DEPDIR)/readline.Plo ./$(DEPDIR)/refresh.Plo \ - ./$(DEPDIR)/search.Plo ./$(DEPDIR)/sig.Plo \ - ./$(DEPDIR)/strlcat.Plo ./$(DEPDIR)/strlcpy.Plo \ - ./$(DEPDIR)/terminal.Plo ./$(DEPDIR)/tokenizer.Plo \ - ./$(DEPDIR)/tokenizern.Plo ./$(DEPDIR)/tty.Plo \ - ./$(DEPDIR)/unvis.Plo ./$(DEPDIR)/vi.Plo ./$(DEPDIR)/vis.Plo \ - ./$(DEPDIR)/wcsdup.Plo + ./$(DEPDIR)/readline.Plo ./$(DEPDIR)/reallocarr.Plo \ + ./$(DEPDIR)/refresh.Plo ./$(DEPDIR)/search.Plo \ + ./$(DEPDIR)/sig.Plo ./$(DEPDIR)/strlcat.Plo \ + ./$(DEPDIR)/strlcpy.Plo ./$(DEPDIR)/terminal.Plo \ + ./$(DEPDIR)/tokenizer.Plo ./$(DEPDIR)/tokenizern.Plo \ + ./$(DEPDIR)/tty.Plo ./$(DEPDIR)/unvis.Plo ./$(DEPDIR)/vi.Plo \ + ./$(DEPDIR)/vis.Plo ./$(DEPDIR)/wcsdup.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -275,6 +275,7 @@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -376,11 +377,11 @@ lib_LTLIBRARIES = libedit.la libedit_la_SOURCES = chared.c common.c el.c eln.c emacs.c hist.c \ keymacro.c map.c chartype.c parse.c prompt.c read.c refresh.c \ - search.c sig.c terminal.c tty.c vi.c wcsdup.c tokenizer.c \ - tokenizern.c history.c historyn.c filecomplete.c readline.c \ - chared.h literal.c el.h hist.h histedit.h keymacro.h map.h \ - chartype.h parse.h prompt.h read.h refresh.h search.h sig.h \ - sys.h terminal.h tty.h vis.h filecomplete.h \ + search.c sig.c terminal.c tty.c vi.c reallocarr.c wcsdup.c \ + tokenizer.c tokenizern.c history.c historyn.c filecomplete.c \ + readline.c chared.h literal.c el.h hist.h histedit.h \ + keymacro.h map.h chartype.h parse.h prompt.h read.h refresh.h \ + search.h sig.h sys.h terminal.h tty.h vis.h filecomplete.h \ editline/readline.h literal.h $(am__append_1) $(am__append_2) \ $(am__append_3) $(am__append_4) $(am__append_5) EXTRA_DIST = makelist shlib_version @@ -484,6 +485,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prompt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readline.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reallocarr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/refresh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig.Plo@am__quote@ # am--include-marker @@ -705,6 +707,7 @@ -rm -f ./$(DEPDIR)/prompt.Plo -rm -f ./$(DEPDIR)/read.Plo -rm -f ./$(DEPDIR)/readline.Plo + -rm -f ./$(DEPDIR)/reallocarr.Plo -rm -f ./$(DEPDIR)/refresh.Plo -rm -f ./$(DEPDIR)/search.Plo -rm -f ./$(DEPDIR)/sig.Plo @@ -781,6 +784,7 @@ -rm -f ./$(DEPDIR)/prompt.Plo -rm -f ./$(DEPDIR)/read.Plo -rm -f ./$(DEPDIR)/readline.Plo + -rm -f ./$(DEPDIR)/reallocarr.Plo -rm -f ./$(DEPDIR)/refresh.Plo -rm -f ./$(DEPDIR)/search.Plo -rm -f ./$(DEPDIR)/sig.Plo
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/chared.c -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/chared.c
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $ */ +/* $NetBSD: chared.c,v 1.62 2022/02/08 21:13:22 rillig Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid = "@(#)chared.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: chared.c,v 1.59 2019/07/23 10:18:52 christos Exp $"); +__RCSID("$NetBSD: chared.c,v 1.62 2022/02/08 21:13:22 rillig Exp $"); #endif #endif /* not lint && not SCCSID */ @@ -624,6 +624,69 @@ el->el_line.cursor = el->el_line.buffer; } +/* el_deletestr1(): + * Delete characters between start and end + */ +int +el_deletestr1(EditLine *el, int start, int end) +{ + size_t line_length, len; + wchar_t *p1, *p2; + + if (end <= start) + return 0; + + line_length = (size_t)(el->el_line.lastchar - el->el_line.buffer); + + if (start >= (int)line_length || end >= (int)line_length) + return 0; + + len = (size_t)(end - start); + if (len > line_length - (size_t)end) + len = line_length - (size_t)end; + + p1 = el->el_line.buffer + start; + p2 = el->el_line.buffer + end; + for (size_t i = 0; i < len; i++) { + *p1++ = *p2++; + el->el_line.lastchar--; + } + + if (el->el_line.cursor < el->el_line.buffer) + el->el_line.cursor = el->el_line.buffer; + + return end - start; +} + +/* el_wreplacestr(): + * Replace the contents of the line with the provided string + */ +int +el_wreplacestr(EditLine *el, const wchar_t *s) +{ + size_t len; + wchar_t * p; + + if (s == NULL || (len = wcslen(s)) == 0) + return -1; + + if (el->el_line.buffer + len >= el->el_line.limit) { + if (!ch_enlargebufs(el, len)) + return -1; + } + + p = el->el_line.buffer; + for (size_t i = 0; i < len; i++) + *p++ = *s++; + + el->el_line.bufferlen = '\0'; + el->el_line.lastchar = el->el_line.buffer + len; + if (el->el_line.cursor > el->el_line.lastchar) + el->el_line.cursor = el->el_line.lastchar; + + return 0; +} + /* el_cursor(): * Move the cursor to the left or the right of the current position */
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/chartype.h -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/chartype.h
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.36 2019/09/15 21:09:11 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.37 2022/04/11 19:37:20 tnn Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -35,6 +35,7 @@ * been around since 2001... */ #if !defined(__NetBSD__) && \ !defined(__sun) && \ + !defined(__osf__) && \ !(defined(__APPLE__) && defined(__MACH__)) && \ !defined(__OpenBSD__) && \ !defined(__FreeBSD__) && \
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/editline/readline.h -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/editline/readline.h
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: readline.h,v 1.47 2021/08/21 12:34:59 christos Exp $ */ +/* $NetBSD: readline.h,v 1.53 2022/02/19 17:45:02 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -94,6 +94,13 @@ #define RL_PROMPT_START_IGNORE '\1' #define RL_PROMPT_END_IGNORE '\2' +#define RL_STATE_NONE 0x000000 +#define RL_STATE_DONE 0x000001 + +#define RL_SETSTATE(x) (rl_readline_state |= ((unsigned long) x)) +#define RL_UNSETSTATE(x) (rl_readline_state &= ~((unsigned long) x)) +#define RL_ISSTATE(x) (rl_readline_state & ((unsigned long) x)) + /* global variables used by readline enabled applications */ #ifdef __cplusplus extern "C" { @@ -120,8 +127,8 @@ extern const char *rl_special_prefixes; extern int rl_completion_append_character; extern int rl_inhibit_completion; -extern Function *rl_pre_input_hook; -extern Function *rl_startup_hook; +extern rl_hook_func_t *rl_pre_input_hook; +extern rl_hook_func_t *rl_startup_hook; extern char *rl_terminal_name; extern int rl_already_prompted; extern char *rl_prompt; @@ -153,6 +160,7 @@ extern int _rl_echoing_p; extern int history_max_entries; extern char *rl_display_prompt; +extern int rl_erase_empty_line; /* supported functions */ char *readline(const char *); @@ -180,7 +188,7 @@ int history_search_pos(const char *, int, int); int read_history(const char *); int write_history(const char *); -int history_truncate_file (const char *, int); +int history_truncate_file(const char *, int); int history_expand(char *, char **); char **history_tokenize(const char *); const char *get_history_event(const char *, int *, int); @@ -215,7 +223,7 @@ HISTORY_STATE *history_get_history_state(void); void rl_get_screen_size(int *, int *); void rl_set_screen_size(int, int); -char *rl_filename_completion_function (const char *, int); +char *rl_filename_completion_function(const char *, int); int _rl_abort_internal(void); int _rl_qsort_string_compare(char **, char **); char **rl_completion_matches(const char *, rl_compentry_func_t *); @@ -226,6 +234,13 @@ void rl_echo_signal_char(int); int rl_crlf(void); int rl_ding(void); +char *rl_copy_text(int, int); +void rl_replace_line(const char *, int); +int rl_delete_text(int, int); +void rl_message(const char *format, ...) + __attribute__((__format__(__printf__, 1, 2))); +void rl_save_prompt(void); +void rl_restore_prompt(void); /* * The following are not implemented @@ -236,6 +251,7 @@ Keymap rl_make_bare_keymap(void); int rl_generic_bind(int, const char *, const char *, Keymap); int rl_bind_key_in_map(int, rl_command_func_t *, Keymap); +int rl_set_key(const char *, rl_command_func_t *, Keymap); void rl_cleanup_after_signal(void); void rl_free_line_state(void); int rl_set_keyboard_input_timeout(int);
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/eln.c -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/eln.c
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: eln.c,v 1.36 2021/08/15 10:08:41 christos Exp $ */ +/* $NetBSD: eln.c,v 1.37 2022/01/11 18:30:15 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: eln.c,v 1.36 2021/08/15 10:08:41 christos Exp $"); +__RCSID("$NetBSD: eln.c,v 1.37 2022/01/11 18:30:15 christos Exp $"); #endif /* not lint && not SCCSID */ #include <errno.h> @@ -386,3 +386,9 @@ { return el_winsertstr(el, ct_decode_string(str, &el->el_lgcyconv)); } + +int +el_replacestr(EditLine *el, const char *str) +{ + return el_wreplacestr(el, ct_decode_string(str, &el->el_lgcyconv)); +}
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/filecomplete.c -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/filecomplete.c
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.c,v 1.68 2021/05/05 14:49:59 christos Exp $ */ +/* $NetBSD: filecomplete.c,v 1.70 2022/03/12 15:29:17 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: filecomplete.c,v 1.68 2021/05/05 14:49:59 christos Exp $"); +__RCSID("$NetBSD: filecomplete.c,v 1.70 2022/03/12 15:29:17 christos Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -70,20 +70,21 @@ char pwbuf1024; #endif struct passwd *pass; + const char *pos; char *temp; size_t len = 0; if (txt0 != '~') return strdup(txt); - temp = strchr(txt + 1, '/'); - if (temp == NULL) { + pos = strchr(txt + 1, '/'); + if (pos == NULL) { temp = strdup(txt + 1); if (temp == NULL) return NULL; } else { /* text until string after slash */ - len = (size_t)(temp - txt + 1); + len = (size_t)(pos - txt + 1); temp = el_calloc(len, sizeof(*temp)); if (temp == NULL) return NULL; @@ -127,7 +128,7 @@ } static int -needs_escaping(char c) +needs_escaping(wchar_t c) { switch (c) { case '\'': @@ -213,9 +214,10 @@ while (temp != el->el_line.cursor) { /* * If we see a single quote but have not seen a double quote - * so far set/unset s_quote + * so far set/unset s_quote, unless it is already quoted */ - if (temp0 == '\'' && !d_quoted) + if (temp0 == '\'' && !d_quoted && + (temp == el->el_line.buffer || temp-1 != '\\')) s_quoted = !s_quoted; /* * vice versa to the above condition @@ -328,14 +330,15 @@ static size_t filename_len = 0; struct dirent *entry; char *temp; + const char *pos; size_t len; if (state == 0 || dir == NULL) { - temp = strrchr(text, '/'); - if (temp) { + pos = strrchr(text, '/'); + if (pos) { char *nptr; - temp++; - nptr = el_realloc(filename, (strlen(temp) + 1) * + pos++; + nptr = el_realloc(filename, (strlen(pos) + 1) * sizeof(*nptr)); if (nptr == NULL) { el_free(filename); @@ -343,8 +346,8 @@ return NULL; } filename = nptr; - (void)strcpy(filename, temp); - len = (size_t)(temp - text); /* including last slash */ + (void)strcpy(filename, pos); + len = (size_t)(pos - text); /* including last slash */ nptr = el_realloc(dirname, (len + 1) * sizeof(*nptr)); @@ -604,13 +607,13 @@ for (;;) { if (ctemp <= buffer) break; - if (wcschr(word_break, ctemp-1)) { - if (ctemp - buffer >= 2 && ctemp-2 == '\\') { - ctemp -= 2; - continue; - } - break; + if (ctemp - buffer >= 2 && ctemp-2 == '\\' && + needs_escaping(ctemp-1)) { + ctemp -= 2; + continue; } + if (wcschr(word_break, ctemp-1)) + break; if (special_prefixes && wcschr(special_prefixes, ctemp-1)) break; ctemp--;
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/filecomplete.h -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/filecomplete.h
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: filecomplete.h,v 1.13 2021/03/28 13:38:10 christos Exp $ */ +/* $NetBSD: filecomplete.h,v 1.14 2021/09/26 13:45:54 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ char **(*)(const char *, int, int), const wchar_t *, const wchar_t *, const char *(*)(const char *), size_t, int *, int *, int *, int *, unsigned int); -#define FN_QUOTE_MATCH 1 /* Quote the returned match */ +#define FN_QUOTE_MATCH 1U /* Quote the returned match */ void fn_display_match_list(EditLine *, char **, size_t, size_t, const char *(*)(const char *));
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/histedit.h -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/histedit.h
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: histedit.h,v 1.58 2021/08/15 10:08:41 christos Exp $ */ +/* $NetBSD: histedit.h,v 1.61 2022/02/08 21:13:22 rillig Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -179,7 +179,8 @@ const LineInfo *el_line(EditLine *); int el_insertstr(EditLine *, const char *); void el_deletestr(EditLine *, int); - +int el_replacestr(EditLine *, const char *); +int el_deletestr1(EditLine *, int, int); /* * ==== History ==== @@ -282,6 +283,7 @@ const LineInfoW *el_wline(EditLine *); int el_winsertstr(EditLine *, const wchar_t *); #define el_wdeletestr el_deletestr +int el_wreplacestr(EditLine *, const wchar_t *); /* * ==== History ====
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/readline.c -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/readline.c
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $ */ +/* $NetBSD: readline.c,v 1.176 2022/09/21 01:33:53 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.167 2021/09/10 13:29:06 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.176 2022/09/21 01:33:53 christos Exp $"); #endif /* not lint && not SCCSID */ #include <sys/types.h> @@ -43,6 +43,7 @@ #include <limits.h> #include <pwd.h> #include <setjmp.h> +#include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -116,8 +117,8 @@ rl_compentry_func_t *rl_completion_entry_function = NULL; char *(*rl_completion_word_break_hook)(void) = NULL; rl_completion_func_t *rl_attempted_completion_function = NULL; -Function *rl_pre_input_hook = NULL; -Function *rl_startup1_hook = NULL; +rl_hook_func_t *rl_pre_input_hook = NULL; +rl_hook_func_t *rl_startup1_hook = NULL; int (*rl_getc_function)(FILE *) = NULL; char *rl_terminal_name = NULL; int rl_already_prompted = 0; @@ -126,12 +127,12 @@ int readline_echoing_p = 1; int _rl_print_completions_horizontally = 0; VFunction *rl_redisplay_function = NULL; -Function *rl_startup_hook = NULL; +rl_hook_func_t *rl_startup_hook = NULL; VFunction *rl_completion_display_matches_hook = NULL; VFunction *rl_prep_term_function = (VFunction *)rl_prep_terminal; VFunction *rl_deprep_term_function = (VFunction *)rl_deprep_terminal; KEYMAP_ENTRY_ARRAY emacs_meta_keymap; -unsigned long rl_readline_state; +unsigned long rl_readline_state = RL_STATE_NONE; int _rl_complete_mark_directories; rl_icppfunc_t *rl_directory_completion_hook; int rl_completion_suppress_append; @@ -140,11 +141,13 @@ int _rl_echoing_p; int history_max_entries; char *rl_display_prompt; +int rl_erase_empty_line; /* * The current prompt string. */ char *rl_prompt = NULL; +char *rl_prompt_saved = NULL; /* * This is set to character indicating type of completion being done by * rl_complete_internal(); this is available for application completion @@ -282,6 +285,21 @@ return 0; } +void +rl_save_prompt(void) +{ + rl_prompt_saved = strdup(rl_prompt); +} + +void +rl_restore_prompt(void) +{ + if (!rl_prompt_saved) + return; + rl_prompt = rl_prompt_saved; + rl_prompt_saved = NULL; +} + /* * initialize rl compat stuff */ @@ -297,6 +315,8 @@ if (h != NULL) history_end(h); + RL_UNSETSTATE(RL_STATE_DONE); + if (!rl_instream) rl_instream = stdin; if (!rl_outstream) @@ -429,7 +449,7 @@ if (e == NULL || h == NULL) rl_initialize(); if (rl_startup_hook) { - (*rl_startup_hook)(NULL, 0); + (*rl_startup_hook)(); } tty_init(e); @@ -444,7 +464,7 @@ goto out; if (rl_pre_input_hook) - (*rl_pre_input_hook)(NULL, 0); + (*rl_pre_input_hook)(); if (rl_event_hook && !(e->el_flags & NO_TTY)) { el_set(e, EL_GETCFN, _rl_event_read_char); @@ -462,10 +482,14 @@ ret = el_gets(e, &count); if (ret && count > 0) { + int lastidx; + buf = strdup(ret); if (buf == NULL) goto out; - bufstrcspn(buf, "\n") = '\0'; + lastidx = count - 1; + if (buflastidx == '\n') + buflastidx = '\0'; } else buf = NULL; @@ -600,7 +624,7 @@ if (sub && cmdidx == '?') break; if (!sub && (cmdidx == ':' || cmdidx == ' ' - || cmdidx == '\t' || cmdidx == qchar)) + || cmdidx == '\t' || cmdidx == qchar)) break; idx++; } @@ -828,7 +852,8 @@ } else { int qchar; - qchar = (offs > 0 && commandoffs - 1 == '"')? '"':0; + qchar = (offs > 0 && commandoffs - 1 == '"') + ? '"' : '\0'; ptr = get_history_event(command + offs, &idx, qchar); } has_mods = commandoffs + (size_t)idx == ':'; @@ -906,7 +931,7 @@ switch (*cmd) { case ':': continue; - case 'h': /* remove trailing path */ + case 'h': /* remove trailing path */ if ((aptr = strrchr(tmp, '/')) != NULL) *aptr = '\0'; continue; @@ -1406,7 +1431,7 @@ return errno; errno = 0; if (history(h, &ev, H_LOAD, filename) == -1) - return errno ? errno : EINVAL; + return errno ? errno : EINVAL; if (history(h, &ev, H_GETSIZE) == 0) history_length = ev.num; if (history_length < 0) @@ -2076,7 +2101,7 @@ rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c) { if (mapc == NULL) - return CC_ERROR; + return CC_ERROR; _rl_update_pos(); @@ -2122,10 +2147,12 @@ if (done == 2) { if ((wbuf = strdup(buf)) != NULL) wbufcount = '\0'; + RL_SETSTATE(RL_STATE_DONE); } else wbuf = NULL; (*(void (*)(const char *))rl_linefunc)(wbuf); } + _rl_update_pos(); } void @@ -2153,6 +2180,7 @@ a0 = (char)e->el_tty.t_cTS_IOC_REPRINT; a1 = '\0'; el_push(e, a); + rl_forced_update_display(); } int @@ -2276,6 +2304,56 @@ rl_line_bufferrl_end = '\0'; } +char *
View file
_service:tar_scm:libedit-20221030-3.1.tar.gz/src/reallocarr.c
Added
@@ -0,0 +1,96 @@ +/* $NetBSD: reallocarr.c,v 1.5 2015/08/20 22:27:49 kamil Exp $ */ + +/*- + * Copyright (c) 2015 Joerg Sonnenberger <joerg@NetBSD.org>. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if !HAVE_REALLOCARR + +#include "config.h" + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +__RCSID("$NetBSD: reallocarr.c,v 1.5 2015/08/20 22:27:49 kamil Exp $"); + +#include <errno.h> +/* Old POSIX has SIZE_MAX in limits.h */ +#include <limits.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#ifdef _LIBC +#ifdef __weak_alias +__weak_alias(reallocarr, _reallocarr) +#endif +#endif + +#define SQRT_SIZE_MAX (((size_t)1) << (sizeof(size_t) * CHAR_BIT / 2)) + +int +reallocarr(void *ptr, size_t number, size_t size) +{ + int saved_errno, result; + void *optr; + void *nptr; + + saved_errno = errno; + memcpy(&optr, ptr, sizeof(ptr)); + if (number == 0 || size == 0) { + free(optr); + nptr = NULL; + memcpy(ptr, &nptr, sizeof(ptr)); + errno = saved_errno; + return 0; + } + + /* + * Try to avoid division here. + * + * It isn't possible to overflow during multiplication if neither + * operand uses any of the most significant half of the bits. + */ + if ((number|size) >= SQRT_SIZE_MAX && + number > SIZE_MAX / size) { + errno = saved_errno; + return EOVERFLOW; + } + + nptr = realloc(optr, number * size); + if (nptr == NULL) { + result = errno; + } else { + result = 0; + memcpy(ptr, &nptr, sizeof(ptr)); + } + errno = saved_errno; + return result; +} +#endif
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/sys.h -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/sys.h
Changed
@@ -40,10 +40,9 @@ #ifndef _h_sys #define _h_sys -#ifdef HAVE_SYS_CDEFS_H -#include <sys/cdefs.h> -#endif +#if defined(HAVE_SYS_TYPES_H) && defined(__sun) #include <sys/types.h> +#endif #if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(A) @@ -97,6 +96,14 @@ ssize_t getline(char **line, size_t *len, FILE *fp); #endif +#ifndef HAVE_HAVE_REALLOCARR +int reallocarr(void *ptr, size_t number, size_t size); +#endif + +#ifndef HAVE_WCSDUP +wchar_t * wcsdup(const wchar_t *str); +#endif + #ifndef _DIAGASSERT #define _DIAGASSERT(x) #endif
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/unvis.c -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/unvis.c
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $ */ +/* $NetBSD: unvis.c,v 1.45 2022/04/19 20:32:15 rillig Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.44 2014/09/26 15:43:36 roy Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.45 2022/04/19 20:32:15 rillig Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -506,7 +506,7 @@ errno = ENOSPC; \ return -1; \ } \ - } while (/*CONSTCOND*/0) + } while (0) while ((c = *src++) != '\0') { again:
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/vis.h -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/vis.h
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.25 2017/04/23 01:57:36 christos Exp $ */ +/* $NetBSD: vis.h,v 1.26 2022/05/20 21:31:24 andvar Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ * to select alternate encoding format */ #define VIS_OCTAL 0x0001 /* use octal \ddd format */ -#define VIS_CSTYLE 0x0002 /* use \nrft0.. where appropiate */ +#define VIS_CSTYLE 0x0002 /* use \nrft0.. where appropriate */ /* * to alter set of characters encoded (default is to encode all
View file
_service:tar_scm:libedit-20210910-3.1.tar.gz/src/wcsdup.c -> _service:tar_scm:libedit-20221030-3.1.tar.gz/src/wcsdup.c
Changed
@@ -1,4 +1,4 @@ -/* $NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $ */ +/* $NetBSD: wcsdup.c,v 1.6 2022/03/12 17:31:40 christos Exp $ */ /* * Copyright (C) 2006 Aleksey Cheusov @@ -16,11 +16,12 @@ #include "config.h" #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsdup.c,v 1.3 2008/05/26 13:17:48 haad Exp $"); +__RCSID("$NetBSD: wcsdup.c,v 1.6 2022/03/12 17:31:40 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <stdlib.h> #include <assert.h> +#include <errno.h> #include <wchar.h> wchar_t * @@ -32,9 +33,10 @@ _DIAGASSERT(str != NULL); len = wcslen(str) + 1; - copy = malloc(len * sizeof (wchar_t)); - if (!copy) + copy = NULL; + errno = reallocarr(©, len, sizeof(*copy)); + if (errno) return NULL; return wmemcpy(copy, str, len);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2