From 1b17e766659d93d1e7bd6633bf78132e1abb3568 Mon Sep 17 00:00:00 2001
From: Elena Zannoni
Date: Sun, 9 Jul 2000 17:20:00 +0000
Subject: [PATCH] readline: 2000-07-09 Elena Zannoni
* Import of readline 4.1.
Locally modified files: Makefile.in, configure.in, configure
(regenerated), config.h.in (regenerated), readline.h, rltty.c,
shell.c signals.c.
Locally added files: acconfig.h, config/*, config.h.bot,
cross-build/*, doc/inc-hit.texinfo.
New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
examples:
2000-07-09 Elena Zannoni
* Import of readline 4.1.
New files: excallback.c, rlfe.c.
doc:
2000-07-09 Elena Zannoni
* Import of readline 4.1.
Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
inclusion in the gdb manual.
New file: rluserman.texinfo
---
readline/CHANGELOG | 123 +
readline/CHANGES | 108 +
readline/COPYING | 4 +-
readline/ChangeLog.Cygnus | 13 +
readline/MANIFEST | 12 +-
readline/Makefile.in | 98 +-
readline/README | 2 +-
readline/aclocal.m4 | 172 +-
readline/ansi_stdlib.h | 2 +-
readline/bind.c | 472 +--
readline/callback.c | 14 +-
readline/chardefs.h | 4 +-
readline/complete.c | 139 +-
readline/config.h.in | 3 +
readline/configure | 277 +-
readline/configure.in | 23 +-
readline/display.c | 351 ++-
readline/doc/ChangeLog | 9 +
readline/doc/Makefile.in | 87 +-
readline/doc/hist.texinfo | 4 +-
readline/doc/history.dvi | Bin 49240 -> 0 bytes
readline/doc/history.html | 1195 -------
readline/doc/history.info | 811 -----
readline/doc/history.ps | 1636 ----------
readline/doc/hstech.texinfo | 9 +-
readline/doc/hsuser.texinfo | 113 +-
readline/doc/inc-hist.texinfo | 117 +-
readline/doc/manvers.texinfo | 10 +-
readline/doc/readline.3 | 11 +-
readline/doc/readline.dvi | Bin 207200 -> 0 bytes
readline/doc/readline.html | 4327 -------------------------
readline/doc/readline.info | 3107 ------------------
readline/doc/readline.ps | 4570 ---------------------------
readline/doc/rlman.texinfo | 4 +-
readline/doc/rltech.texinfo | 51 +-
readline/doc/rluser.texinfo | 448 ++-
readline/doc/rluserman.dvi | Bin 61412 -> 0 bytes
readline/doc/rluserman.html | 1566 ----------
readline/doc/rluserman.info | 1189 -------
readline/doc/rluserman.ps | 1897 -----------
readline/doc/texinfo.tex | 4692 ----------------------------
readline/emacs_keymap.c | 16 +-
readline/examples/ChangeLog.Cygnus | 6 +
readline/examples/Makefile.in | 38 +-
readline/examples/fileman.c | 26 +-
readline/examples/rl.c | 39 +-
readline/examples/rltest.c | 16 +-
readline/examples/rlversion.c | 8 +-
readline/funmap.c | 16 +-
readline/histexpand.c | 18 +-
readline/histfile.c | 89 +-
readline/histlib.h | 12 +-
readline/history.c | 6 +-
readline/history.h | 10 +-
readline/histsearch.c | 7 +-
readline/input.c | 92 +-
readline/isearch.c | 21 +-
readline/keymaps.c | 14 +-
readline/keymaps.h | 12 +-
readline/kill.c | 39 +-
readline/macro.c | 19 +-
readline/nls.c | 21 +-
readline/parens.c | 41 +-
readline/posixdir.h | 4 +-
readline/posixjmp.h | 18 +
readline/posixstat.h | 4 +-
readline/readline.c | 207 +-
readline/readline.h | 25 +-
readline/rlconf.h | 8 +-
readline/rldefs.h | 7 +-
readline/rlstdc.h | 52 +-
readline/rltty.c | 208 +-
readline/rltty.h | 25 +-
readline/rlwinsize.h | 5 +-
readline/savestring.c | 4 +-
readline/search.c | 182 +-
readline/shell.c | 50 +-
readline/shlib/Makefile.in | 61 +-
readline/signals.c | 54 +-
readline/support/config.guess | 382 ++-
readline/support/config.sub | 397 ++-
readline/support/shlib-install | 47 +-
readline/support/shobj-conf | 46 +-
readline/tcap.h | 4 +-
readline/terminal.c | 235 +-
readline/tilde.c | 55 +-
readline/tilde.h | 28 +-
readline/undo.c | 6 +-
readline/util.c | 24 +-
readline/vi_keymap.c | 4 +-
readline/vi_mode.c | 33 +-
readline/xmalloc.c | 27 +-
92 files changed, 3648 insertions(+), 26790 deletions(-)
delete mode 100644 readline/doc/history.dvi
delete mode 100644 readline/doc/history.html
delete mode 100644 readline/doc/history.info
delete mode 100644 readline/doc/history.ps
delete mode 100644 readline/doc/readline.dvi
delete mode 100644 readline/doc/readline.html
delete mode 100644 readline/doc/readline.info
delete mode 100644 readline/doc/readline.ps
delete mode 100644 readline/doc/rluserman.dvi
delete mode 100644 readline/doc/rluserman.html
delete mode 100644 readline/doc/rluserman.info
delete mode 100644 readline/doc/rluserman.ps
delete mode 100644 readline/doc/texinfo.tex
create mode 100644 readline/examples/ChangeLog.Cygnus
diff --git a/readline/CHANGELOG b/readline/CHANGELOG
index 479e6c042ac..9024bdfdadb 100644
--- a/readline/CHANGELOG
+++ b/readline/CHANGELOG
@@ -214,3 +214,126 @@ Makefile.in,{doc,examples,shlib}/Makefile.in
- set SHELL from @MAKE_SHELL@
[readline-4.0 released]
+
+ 3/11
+ ----
+doc/Makefile.in
+ - removed references to HTMLTOC, since separate HTML table-of-contents
+ files are no longer created
+
+examples/Makefile.in
+ - remove `*.exe' in clean target for MS-DOS
+
+Makefile.in
+ - make `readline' target depend on ./libreadline.a
+ - configure now substitutes TERMCAP_LIB into Makefile.in
+ - use ${TERMCAP_LIB} instead of -ltermcap in recipe for `readline'
+ - clean target now removes readline and readline.exe in case they
+ get built
+
+configure.in
+ - use `pwd.exe' to set BUILD_DIR on MS-DOS DJGPP
+
+ 3/15
+ ----
+support/shlib-install
+ - Irix 5.x and Irix 6.x should install shared libraries like Solaris 2
+ - changes for installing on hp-ux 1[01].x
+
+ 3/23
+ ----
+configure.in
+ - make sure that the $CC argument to shobj-conf is quoted
+
+ 4/8
+ ---
+
+xmalloc.h, rlprivate.h, rlshell.h
+ - new files
+
+Makefile.in,shlib/Makefile.in
+ - add dependencies on xmalloc.h, rlshell.h
+ - add xmalloc.h, rlprivate.h, rlshell.h to list of header files
+
+MANIFEST
+ - add xmalloc.h, rlprivate.h, rlshell.h
+
+ 4/9
+ ---
+Makefile.in,shlib/Makefile.in
+ - add dependencies on rlprivate.h
+
+ 4/13
+ ----
+doc/Makefile.in
+ - add variable, PSDVI, which is the desired resolution of the
+ generated postscript files. Set to 300 because I don't have
+ any 600-dpi printers
+ - set LANGUAGE= before calling makeinfo, so messages are in English
+ - add rluserman.{info,dvi,ps,html} to appropriate variables
+ - add rules to create rluserman.{info,dvi,ps,html}
+ - install and uninstall rluserman.info, but don't update the directory
+ file in $(infodir) yet
+
+MANIFEST
+ - add doc/rluserman.{texinfo,info,dvi,ps,html}
+
+ 4/30
+ ----
+configure.in
+ - updated library version to 4.1
+
+ 5/3
+ ---
+configure.in
+ - SHLIB_MAJOR and SHLIB_MINOR shared library version numbers are
+ constructed from $LIBRARY_VERSION and substituted into Makefiles
+
+ 5/5
+ ---
+support/shlib-install
+ - OSF/1 installs shared libraries like Solaris
+
+Makefile.in
+ - broke the header file install and uninstall into two new targets:
+ install-headers and uninstall-headers
+ - install and uninstall depend on install-headers and uninstall-headers
+ respectively
+ - changed install-shared and uninstall-shared targets to depend on
+ install-headers and uninstall-headers, respectively, so users may
+ choose to install only the shared libraries. I'm not sure about
+ the uninstall one yet -- maybe it should check whether or not
+ the static libraries are installed and not remove the header files
+ if they are
+
+ 9/3
+ ---
+configure.in, config.h.in
+ - added test for memmove (for later use)
+ - changed version to 4.1-beta1
+
+ 9/13
+ ----
+examples/rlfe.c
+ - Per Bothner's `rlfe' readline front-end program
+
+examples/Makefile.in
+ - added rules to build rlfe
+
+ 9/21
+ ----
+support/shlib-install
+ - changes to handle FreeBSD-3.x elf or a.out shared libraries, which
+ have different semantics and need different naming conventions
+
+ 1/24/2000
+ ---------
+doc/Makefile.in
+ - remove *.bt and *.bts on `make clean'
+
+ 2/4
+ ---
+
+
+configure.in
+ - changed LIBVERSION to 4.1-beta5
diff --git a/readline/CHANGES b/readline/CHANGES
index 65339c2e036..d2929ab6fd2 100644
--- a/readline/CHANGES
+++ b/readline/CHANGES
@@ -1,3 +1,111 @@
+This document details the changes between this version, readline-4.1,
+and the previous version, readline-4.0.
+
+1. Changes to Readline
+
+a. Changed the HTML documents so that the table-of-contents is no longer
+ a separate file.
+
+b. Changes to the shared object configuration for: Irix 5.x, Irix 6.x,
+ OSF/1.
+
+c. The shared library major and minor versions are now constructed
+ automatically by configure and substituted into the makefiles.
+
+d. It's now possible to install the shared libraries separately from the
+ static libraries.
+
+e. The history library tries to truncate the history file only if it is a
+ regular file.
+
+f. A bug that caused _rl_dispatch to address negative array indices on
+ systems with signed chars was fixed.
+
+g. rl-yank-nth-arg now leaves the history position the same as when it was
+ called.
+
+h. Changes to the completion code to handle MS-DOS drive-letter:pathname
+ filenames.
+
+i. Completion is now case-insensitive by default on MS-DOS.
+
+j. Fixes to the history file manipulation code for MS-DOS.
+
+k. Readline attempts to bind the arrow keys to appropriate defaults on MS-DOS.
+
+l. Some fixes were made to the redisplay code for better operation on MS-DOS.
+
+m. The quoted-insert code will now insert tty special chars like ^C.
+
+n. A bug was fixed that caused the display code to reference memory before
+ the start of the prompt string.
+
+o. More support for __EMX__ (OS/2).
+
+p. A bug was fixed in readline's signal handling that could cause infinite
+ recursion in signal handlers.
+
+q. A bug was fixed that caused the point to be less than zero when rl_forward
+ was given a very large numeric argument.
+
+r. The vi-mode code now gets characters via the application-settable value
+ of rl_getc_function rather than calling rl_getc directly.
+
+s. The history file code now uses O_BINARY mode when reading and writing
+ the history file on cygwin32.
+
+t. Fixed a bug in the redisplay code for lines with more than 256 line
+ breaks.
+
+u. A bug was fixed which caused invisible character markers to not be
+ stripped from the prompt string if the terminal was in no-echo mode.
+
+v. Readline no longer tries to get the variables it needs for redisplay
+ from the termcap entry if the calling application has specified its
+ own redisplay function. Readline treats the terminal as `dumb' in
+ this case.
+
+w. Fixes to the SIGWINCH code so that a multiple-line prompt with escape
+ sequences is redrawn correctly.
+
+x. Changes to the install and install-shared targets so that the libraries
+ and header files are installed separately.
+
+2. New Features in Readline
+
+a. A new Readline `user manual' is in doc/rluserman.texinfo.
+
+b. Parentheses matching is now always compiled into readline, and enabled
+ or disabled when the value of the `blink-matching-paren' variable is
+ changed.
+
+c. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename.
+
+d. MS-DOS systems now use ~/_history as the default history file.
+
+e. history-search-{forward,backward} now leave the point at the end of the
+ line when the string to search for is empty, like
+ {reverse,forward}-search-history.
+
+f. history-search-{forward,backward} now leave the last history line found
+ in the readline buffer if the second or subsequent search fails.
+
+g. New function for use by applications: rl_on_new_line_with_prompt, used
+ when an application displays the prompt itself before calling readline().
+
+h. New variable for use by applications: rl_already_prompted. An application
+ that displays the prompt itself before calling readline() must set this to
+ a non-zero value.
+
+i. A new variable, rl_gnu_readline_p, always 1. The intent is that an
+ application can verify whether or not it is linked with the `real'
+ readline library or some substitute.
+
+j. Per Bothner's `rlfe' (pronounced `Ralphie') readline front-end program
+ is included in the examples subdirectory, though it is not built
+ by default.
+
+-------------------------------------------------------------------------------
This document details the changes between this version, readline-4.0,
and the previous version, readline-2.2.
diff --git a/readline/COPYING b/readline/COPYING
index a43ea2126fb..1bf15263878 100644
--- a/readline/COPYING
+++ b/readline/COPYING
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Also add information on how to contact you by electronic and paper mail.
diff --git a/readline/ChangeLog.Cygnus b/readline/ChangeLog.Cygnus
index bc53a327fea..40baa984a2a 100644
--- a/readline/ChangeLog.Cygnus
+++ b/readline/ChangeLog.Cygnus
@@ -1,3 +1,16 @@
+2000-07-09 Elena Zannoni
+
+ * Import of readline 4.1.
+
+ Locally modified files: Makefile.in, configure.in, configure
+ (regenerated), config.h.in (regenerated), readline.h, rltty.c,
+ shell.c signals.c.
+
+ Locally added files: acconfig.h, config/*, config.h.bot,
+ cross-build/*, doc/inc-hit.texinfo.
+
+ New files: USAGE, rlprivate.h, rlshell.h, xmalloc.h.
+
2000-03-16 Eli Zaretskii
* support/shobj-conf: Shared libs are unsupported on MSDOS.
diff --git a/readline/MANIFEST b/readline/MANIFEST
index f23ff41aff8..a51ca0525a7 100644
--- a/readline/MANIFEST
+++ b/readline/MANIFEST
@@ -11,8 +11,8 @@ MANIFEST f
INSTALL f
CHANGELOG f
CHANGES f
+USAGE f
aclocal.m4 f
-acconfig.h f
config.h.in f
configure f
configure.in f
@@ -28,11 +28,14 @@ posixstat.h f
readline.h f
rlconf.h f
rldefs.h f
+rlprivate.h f
+rlshell.h f
rlstdc.h f
rltty.h f
rlwinsize.h f
tcap.h f
tilde.h f
+xmalloc.h f
bind.c f
complete.c f
display.c f
@@ -77,6 +80,7 @@ doc/manvers.texinfo f
doc/rlman.texinfo f
doc/rltech.texinfo f
doc/rluser.texinfo f
+doc/rluserman.texinfo f
doc/hist.texinfo f
doc/hstech.texinfo f
doc/hsuser.texinfo f
@@ -84,8 +88,10 @@ doc/readline.3 f
doc/texi2dvi f
doc/texi2html f
examples/Makefile.in f
+examples/excallback.c f
examples/fileman.c f
examples/manexamp.c f
+examples/rlfe.c f
examples/rltest.c f
examples/rl.c f
examples/rlversion.c f
@@ -94,10 +100,14 @@ examples/Inputrc f
# formatted documentation, from MANIFEST.doc
doc/readline.ps f
doc/history.ps f
+doc/rluserman.ps f
doc/readline.dvi f
doc/history.dvi f
+doc/rluserman.dvi f
doc/readline.info f
doc/history.info f
+doc/rluserman.info f
doc/readline.html f
doc/history.html f
+doc/rluserman.html f
doc/readline.0 f
diff --git a/readline/Makefile.in b/readline/Makefile.in
index 5c667ed69f5..3069ff7885e 100644
--- a/readline/Makefile.in
+++ b/readline/Makefile.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
RL_LIBRARY_VERSION = @LIBVERSION@
RL_LIBRARY_NAME = readline
@@ -60,6 +60,8 @@ CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
+TERMCAP_LIB = @TERMCAP_LIB@
+
# For libraries which include headers from other libraries.
INCLUDES = -I. -I$(srcdir) -I$(includedir)
@@ -88,7 +90,7 @@ CSOURCES = $(srcdir)/readline.c $(srcdir)/funmap.c $(srcdir)/keymaps.c \
# The header files for this library.
HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
- ansi_stdlib.h tcap.h rlstdc.h
+ ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h
HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o
TILDEOBJ = tilde.o
@@ -115,6 +117,8 @@ INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
all: static
+everything: static shared examples
+
static: $(STATIC_LIBS)
libreadline.a: $(OBJECTS)
@@ -127,8 +131,8 @@ libhistory.a: $(HISTOBJ) xmalloc.o
$(AR) $(ARFLAGS) $@ $(HISTOBJ) xmalloc.o
-test -n "$(RANLIB)" && $(RANLIB) $@
-readline: $(OBJECTS) readline.h rldefs.h chardefs.h
- $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a -ltermcap
+readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
+ $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
Makefile makefile: config.status $(srcdir)/Makefile.in
CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
@@ -147,9 +151,8 @@ stamp-h: config.status $(srcdir)/config.h.in
CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
echo > $@
-# CYGNUS LOCAL: Never run autoconf.
-#$(srcdir)/configure: $(srcdir)/configure.in Comment-me-out in distribution
-# cd $(srcdir) && autoconf Comment-me-out in distribution
+#$(srcdir)/configure: $(srcdir)/configure.in ## Comment-me-out in distribution
+# cd $(srcdir) && autoconf ## Comment-me-out in distribution
shared: force
-test -d shlib || mkdir shlib
@@ -165,6 +168,17 @@ examples: force
force:
+install-headers: installdirs ${INSTALLED_HEADERS}
+ for f in ${INSTALLED_HEADERS}; do \
+ $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
+ done
+
+uninstall-headers:
+ -test -n "$(includedir)" && cd $(includedir)/readline && \
+ ${RM} ${INSTALLED_HEADERS}
+
+maybe-uninstall-headers: uninstall-headers
+
## CYGNUS LOCAL
## Don't mess with people's installed readline's.
## This tries to install this version of readline over whatever
@@ -175,14 +189,11 @@ force:
install:
-#install: installdirs $(STATIC_LIBS)
-# for f in ${INSTALLED_HEADERS}; do \
-# $(INSTALL_DATA) $(srcdir)/$$f $(includedir)/readline ; \
-# done
-# -( if test -f $(libdir)/libreadline.a ; then $(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old; fi )
+#install: installdirs $(STATIC_LIBS) install-headers
+# -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
# $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
# -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
-# -( if test -f $(libdir)/libhistory.a; then $(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old; fi )
+# -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
# $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
# -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
# -( if test -d doc ; then \
@@ -194,16 +205,14 @@ installdirs: $(srcdir)/support/mkdirs
-$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
$(includedir)/readline $(libdir) $(infodir) $(man3dir)
-uninstall:
- -test -n "$(includedir)" && cd $(includedir)/readline && \
- ${RM} ${INSTALLED_HEADERS}
+uninstall: uninstall-headers
-test -n "$(libdir)" && cd $(libdir) && \
${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS)
-install-shared: installdirs shared
+install-shared: installdirs install-headers shared
-( cd shlib ; ${MAKE} ${MFLAGS} install )
-uninstall-shared:
+uninstall-shared: maybe-uninstall-headers
-( cd shlib; ${MAKE} ${MFLAGS} uninstall )
TAGS: force
@@ -214,6 +223,7 @@ tags: force
clean: force
$(RM) $(OBJECTS) $(STATIC_LIBS)
+ $(RM) readline readline.exe
-( cd shlib && $(MAKE) $(MFLAGS) $@ )
-( cd doc && $(MAKE) $(MFLAGS) $@ )
-( cd examples && $(MAKE) $(MFLAGS) $@ )
@@ -241,7 +251,7 @@ installcheck:
dist: force
@echo Readline distributions are created using $(srcdir)/support/mkdist.
@echo Here is a sample of the necessary commands:
- @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION)
+ @echo bash $(srcdir)/support/mkdist -m $(srcdir)/MANIFEST -s $(srcdir) -r $(RL_LIBRARY_NAME) $(RL_LIBRARY_VERSION)
@echo tar cf $(RL_LIBRARY_NAME)-${RL_LIBRARY_VERSION}.tar ${RL_LIBRARY_NAME}-$(RL_LIBRARY_VERSION)
@echo gzip $(RL_LIBRARY_NAME)-$(RL_LIBRARY_VERSION).tar
@@ -300,6 +310,8 @@ macro.o: readline.h keymaps.h chardefs.h tilde.h
macro.o: history.h rlstdc.h
nls.o: ansi_stdlib.h
nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
+nls.o: readline.h keymaps.h chardefs.h tilde.h
+nls.o: history.h rlstdc.h
parens.o: rlconf.h
parens.o: ${BUILD_DIR}/config.h
parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
@@ -338,6 +350,54 @@ vi_mode.o: history.h ansi_stdlib.h rlstdc.h
xmalloc.o: ${BUILD_DIR}/config.h
xmalloc.o: ansi_stdlib.h
+bind.o: rlshell.h
+histfile.o: rlshell.h
+nls.o: rlshell.h
+readline.o: rlshell.h
+shell.o: rlshell.h
+terminal.o: rlshell.h
+histexpand.o: rlshell.h
+
+bind.o: rlprivate.h
+callback.o: rlprivate.h
+complete.o: rlprivate.h
+display.o: rlprivate.h
+input.o: rlprivate.h
+isearch.o: rlprivate.h
+kill.o: rlprivate.h
+macro.o: rlprivate.h
+nls.o: rlprivate.h
+parens.o: rlprivate.h
+readline.o: rlprivate.h
+rltty.o: rlprivate.h
+search.o: rlprivate.h
+signals.o: rlprivate.h
+terminal.o: rlprivate.h
+undo.o: rlprivate.h
+util.o: rlprivate.h
+vi_mode.o: rlprivate.h
+
+bind.o: xmalloc.h
+complete.o: xmalloc.h
+display.o: xmalloc.h
+funmap.o: xmalloc.h
+histexpand.o: xmalloc.h
+histfile.o: xmalloc.h
+history.o: xmalloc.h
+input.o: xmalloc.h
+isearch.o: xmalloc.h
+keymaps.o: xmalloc.h
+kill.o: xmalloc.h
+macro.o: xmalloc.h
+readline.o: xmalloc.h
+savestring.o: xmalloc.h
+search.o: xmalloc.h
+shell.o: xmalloc.h
+tilde.o: xmalloc.h
+tilde.o: xmalloc.h
+util.o: xmalloc.h
+vi_mode.o: xmalloc.h
+
readline.o: $(srcdir)/readline.c
vi_mode.o: $(srcdir)/vi_mode.c
funmap.o: $(srcdir)/funmap.c
diff --git a/readline/README b/readline/README
index 56565b2fb80..41a5d0c82d6 100644
--- a/readline/README
+++ b/readline/README
@@ -1,7 +1,7 @@
Introduction
============
-This is the Gnu Readline library, version 4.0.
+This is the Gnu Readline library, version 4.1.
The Readline library provides a set of functions for use by applications
that allow users to edit command lines as they are typed in. Both
diff --git a/readline/aclocal.m4 b/readline/aclocal.m4
index c277a0c6105..f8f5b74b72f 100644
--- a/readline/aclocal.m4
+++ b/readline/aclocal.m4
@@ -316,13 +316,19 @@ AC_CACHE_VAL(bash_cv_opendir_not_robust,
main()
{
DIR *dir;
-int fd;
-unlink("/tmp/not_a_directory");
-fd = open("/tmp/not_a_directory", O_WRONLY|O_CREAT, 0666);
+int fd, err;
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror("mkdir");
+ exit(1);
+}
+unlink("/tmp/bash-aclocal/not_a_directory");
+fd = open("/tmp/bash-aclocal/not_a_directory", O_WRONLY|O_CREAT|O_EXCL, 0666);
write(fd, "\n", 1);
close(fd);
-dir = opendir("/tmp/not_a_directory");
-unlink("/tmp/not_a_directory");
+dir = opendir("/tmp/bash-aclocal/not_a_directory");
+unlink("/tmp/bash-aclocal/not_a_directory");
+rmdir("/tmp/bash-aclocal");
exit (dir == 0);
}], bash_cv_opendir_not_robust=yes,bash_cv_opendir_not_robust=no,
[AC_MSG_WARN(cannot check opendir if cross compiling -- defaulting to no)
@@ -354,25 +360,59 @@ AC_DEFINE(VOID_SIGHANDLER)
fi
])
-AC_DEFUN(BASH_TYPE_INT32_T,
+dnl
+dnl A signed 16-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS16_T,
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(bits16_t, short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(bits16_t, char)
+else
+ AC_CHECK_TYPE(bits16_t, short)
+fi
+])
+
+dnl
+dnl An unsigned 16-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_U_BITS16_T,
+[
+if test "$ac_cv_sizeof_short" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+elif test "$ac_cv_sizeof_char" = 2; then
+ AC_CHECK_TYPE(u_bits16_t, unsigned char)
+else
+ AC_CHECK_TYPE(u_bits16_t, unsigned short)
+fi
+])
+
+dnl
+dnl A signed 32-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_BITS32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
- AC_CHECK_TYPE(int32_t, int)
+ AC_CHECK_TYPE(bits32_t, int)
elif test "$ac_cv_sizeof_long" = 4; then
- AC_CHECK_TYPE(int32_t, long)
+ AC_CHECK_TYPE(bits32_t, long)
else
- AC_CHECK_TYPE(int32_t, int)
+ AC_CHECK_TYPE(bits32_t, int)
fi
])
-AC_DEFUN(BASH_TYPE_U_INT32_T,
+dnl
+dnl An unsigned 32-bit integer quantity
+dnl
+AC_DEFUN(BASH_TYPE_U_BITS32_T,
[
if test "$ac_cv_sizeof_int" = 4; then
- AC_CHECK_TYPE(u_int32_t, unsigned int)
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
elif test "$ac_cv_sizeof_long" = 4; then
- AC_CHECK_TYPE(u_int32_t, unsigned long)
+ AC_CHECK_TYPE(u_bits32_t, unsigned long)
else
- AC_CHECK_TYPE(u_int32_t, unsigned int)
+ AC_CHECK_TYPE(u_bits32_t, unsigned int)
fi
])
@@ -387,6 +427,9 @@ else
fi
])
+dnl
+dnl A signed 64-bit quantity
+dnl
AC_DEFUN(BASH_TYPE_BITS64_T,
[
if test "$ac_sv_sizeof_char_p" = 8; then
@@ -427,6 +470,20 @@ if test $bash_cv_func_lstat = yes; then
fi
])
+AC_DEFUN(BASH_FUNC_INET_ATON,
+[
+AC_CACHE_CHECK([for inet_aton], bash_cv_func_inet_aton,
+[AC_TRY_LINK([
+#include
+#include
+#include
+struct in_addr ap;], [ inet_aton("127.0.0.1", &ap); ],
+bash_cv_func_inet_aton=yes, bash_cv_func_inet_aton=no)])
+if test $bash_cv_func_inet_aton = yes; then
+ AC_DEFINE(HAVE_INET_ATON)
+fi
+])
+
AC_DEFUN(BASH_STRUCT_TERMIOS_LDISC,
[AC_MSG_CHECKING([for a c_line member of struct termios])
AC_CACHE_VAL(bash_cv_termios_ldisc,
@@ -845,7 +902,7 @@ AC_CACHE_VAL(bash_cv_sys_named_pipes,
/* Add more tests in here as appropriate. */
main()
{
-int fd;
+int fd, err;
#if defined (HAVE_MKFIFO)
exit (0);
@@ -858,12 +915,19 @@ exit (1);
#if defined (NeXT)
exit (1);
#endif
-
-fd = mknod ("/tmp/sh-np-autoconf", 0666 | S_IFIFO, 0);
-if (fd == -1)
+err = mkdir("/tmp/bash-aclocal", 0700);
+if (err < 0) {
+ perror ("mkdir");
+ exit(1);
+}
+fd = mknod ("/tmp/bash-aclocal/sh-np-autoconf", 0666 | S_IFIFO, 0);
+if (fd == -1) {
+ rmdir ("/tmp/bash-aclocal");
exit (1);
+}
close(fd);
-unlink ("/tmp/sh-np-autoconf");
+unlink ("/tmp/bash-aclocal/sh-np-autoconf");
+rmdir ("/tmp/bash-aclocal");
exit(0);
}], bash_cv_sys_named_pipes=present, bash_cv_sys_named_pipes=missing,
[AC_MSG_WARN(cannot check for named pipes if cross-compiling -- defaulting to missing)
@@ -1037,12 +1101,32 @@ elif test $bash_cv_dev_fd = "whacky"; then
fi
])
+AC_DEFUN(BASH_CHECK_DEV_STDIN,
+[AC_MSG_CHECKING(whether /dev/stdin stdout stderr are available)
+AC_CACHE_VAL(bash_cv_dev_stdin,
+[if test -d /dev/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ elif test -d /proc/self/fd && test -r /dev/stdin; then
+ bash_cv_dev_stdin=present
+ else
+ bash_cv_dev_stdin=absent
+ fi
+])
+AC_MSG_RESULT($bash_cv_dev_stdin)
+if test $bash_cv_dev_stdin = "present"; then
+ AC_DEFINE(HAVE_DEV_STDIN)
+fi
+])
+
+dnl
+dnl Check for the presence of getpeername in libsocket.
+dnl If libsocket is present, check for libnsl and add it to LIBS if
+dnl it's there, since most systems with libsocket require linking
+dnl with libnsl as well. This should only be called if getpeername
+dnl was not found in libc.
dnl
-dnl Check for the presence of getpeername (the only networking function
-dnl bash currently requires) in libsocket. If libsocket is present,
-dnl check for libnsl and add it to LIBS if it's there, since most
-dnl systems with libsocket require linking with libnsl as well.
-dnl This should only be called if getpeername was not found in libc.
+dnl NOTE: IF WE FIND GETPEERNAME, WE ASSUME THAT WE HAVE BIND/CONNECT
+dnl AS WELL
dnl
AC_DEFUN(BASH_CHECK_SOCKLIB,
[
@@ -1084,6 +1168,32 @@ if test $bash_cv_have_socklib = yes; then
fi
])
+dnl
+dnl This needs BASH_CHECK_SOCKLIB, but since that's not called on every
+dnl system, we can't use AC_PREREQ
+dnl
+AC_DEFUN(BASH_FUNC_GETHOSTBYNAME,
+[if test "X$bash_cv_have_gethostbyname" = "X"; then
+_bash_needmsg=yes
+else
+AC_MSG_CHECKING(for gethostbyname in socket library)
+_bash_needmsg=
+fi
+AC_CACHE_VAL(bash_cv_have_gethostbyname,
+[AC_TRY_LINK([#include ],
+[ struct hostent *hp;
+ hp = gethostbyname("localhost");
+], bash_cv_have_gethostbyname=yes, bash_cv_have_gethostbyname=no)]
+)
+if test "X$_bash_needmsg" = Xyes; then
+ AC_MSG_CHECKING(for gethostbyname in socket library)
+fi
+AC_MSG_RESULT($bash_cv_have_gethostbyname)
+if test "$bash_cv_have_gethostbyname" = yes; then
+AC_DEFINE(HAVE_GETHOSTBYNAME)
+fi
+])
+
AC_DEFUN(BASH_DEFAULT_MAIL_DIR,
[AC_MSG_CHECKING(for default mail directory)
AC_CACHE_VAL(bash_cv_mail_dir,
@@ -1299,3 +1409,19 @@ switch (0) case 0: case (sizeof (off_t) <= 4):;
if test $bash_cv_off_t_64 = yes; then
AC_DEFINE(HAVE_OFF_T_64)
fi])
+
+AC_DEFUN(BASH_STRUCT_TIMEVAL,
+[AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h)
+AC_CACHE_VAL(bash_cv_struct_timeval,
+[
+AC_EGREP_HEADER(struct timeval, sys/time.h,
+ bash_cv_struct_timeval=yes,
+ AC_EGREP_HEADER(struct timeval, time.h,
+ bash_cv_struct_timeval=yes,
+ bash_cv_struct_timeval=no))
+])
+AC_MSG_RESULT($bash_cv_struct_timeval)
+if test $bash_cv_struct_timeval = yes; then
+ AC_DEFINE(HAVE_TIMEVAL)
+fi
+])
diff --git a/readline/ansi_stdlib.h b/readline/ansi_stdlib.h
index 52339da5d33..a720cb9bcbc 100644
--- a/readline/ansi_stdlib.h
+++ b/readline/ansi_stdlib.h
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License along
with Bash; see the file COPYING. If not, write to the Free Software
- Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+ Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if !defined (_STDLIB_H_)
#define _STDLIB_H_ 1
diff --git a/readline/bind.c b/readline/bind.c
index 73cd827357d..6a6424e9e02 100644
--- a/readline/bind.c
+++ b/readline/bind.c
@@ -7,7 +7,7 @@
The GNU Readline Library 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 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -42,7 +42,6 @@
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
-#include
#include
#if !defined (errno)
@@ -58,65 +57,25 @@ extern int errno;
#include "readline.h"
#include "history.h"
+#include "rlprivate.h"
+#include "rlshell.h"
+#include "xmalloc.h"
+
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
-extern int _rl_horizontal_scroll_mode;
-extern int _rl_mark_modified_lines;
-extern int _rl_bell_preference;
-extern int _rl_meta_flag;
-extern int _rl_convert_meta_chars_to_ascii;
-extern int _rl_output_meta_chars;
-extern int _rl_complete_show_all;
-extern int _rl_complete_mark_directories;
-extern int _rl_print_completions_horizontally;
-extern int _rl_completion_case_fold;
-extern int _rl_enable_keypad;
-#if defined (PAREN_MATCHING)
-extern int rl_blink_matching_paren;
-#endif /* PAREN_MATCHING */
-#if defined (VISIBLE_STATS)
-extern int rl_visible_stats;
-#endif /* VISIBLE_STATS */
-extern int rl_complete_with_tilde_expansion;
-extern int rl_completion_query_items;
-extern int rl_inhibit_completion;
-extern char *_rl_comment_begin;
-extern unsigned char *_rl_isearch_terminators;
-
-extern int rl_explicit_arg;
-extern int rl_editing_mode;
-extern unsigned char _rl_parsing_conditionalized_out;
-extern Keymap _rl_keymap;
-
-extern char *possible_control_prefixes[], *possible_meta_prefixes[];
-
-/* Functions imported from funmap.c */
-extern char **rl_funmap_names ();
-extern int rl_add_funmap_entry ();
-
-/* Functions imported from util.c */
-extern char *_rl_strindex ();
-
-/* Functions imported from shell.c */
-extern char *get_env_value ();
-
/* Variables exported by this file. */
Keymap rl_binding_keymap;
-/* Forward declarations */
-void rl_set_keymap_from_edit_mode ();
+static int _rl_read_init_file __P((char *, int));
+static int glean_key_from_name __P((char *));
+static int substring_member_of_array __P((char *, char **));
-static int _rl_read_init_file ();
-static int glean_key_from_name ();
-static int substring_member_of_array ();
+static int currently_reading_init_file;
-extern char *xmalloc (), *xrealloc ();
+/* used only in this file */
+static int _rl_prefer_visible_bell = 1;
/* **************************************************************** */
/* */
@@ -650,7 +609,7 @@ _rl_read_file (filename, sizep)
char *buffer;
int i, file;
- if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY | O_BINARY, 0666)) < 0)
+ if ((stat (filename, &finfo) < 0) || (file = open (filename, O_RDONLY, 0666)) < 0)
return ((char *)NULL);
file_size = (size_t)finfo.st_size;
@@ -671,7 +630,7 @@ _rl_read_file (filename, sizep)
i = read (file, buffer, file_size);
close (file);
-#if 1
+#if 0
if (i < file_size)
#else
if (i < 0)
@@ -681,33 +640,16 @@ _rl_read_file (filename, sizep)
return ((char *)NULL);
}
+#if 0
buffer[file_size] = '\0';
-
-#if O_BINARY
- {
- /* Systems which distinguish between text and binary files need
- to strip the CR characters before each Newline, otherwise the
- parsing functions won't work. */
- char *s, *d;
- size_t removed = 0;
-
- for (s = buffer, d = buffer; s < buffer + file_size; s++)
- {
- if (removed)
- *d = *s;
- if (*s != '\r' || s[1] != '\n')
- d++;
- else
- removed++;
- }
-
- file_size -= removed;
- buffer[file_size] = '\0';
- }
-#endif
-
if (sizep)
*sizep = file_size;
+#else
+ buffer[i] = '\0';
+ if (sizep)
+ *sizep = i;
+#endif
+
return (buffer);
}
@@ -727,7 +669,6 @@ rl_re_read_init_file (count, ignore)
1. the filename used for the previous call
2. the value of the shell variable `INPUTRC'
3. ~/.inputrc
- 4. (for __MSDOS__ only) ~/_inputrc
If the file existed and could be opened and read, 0 is returned,
otherwise errno is returned. */
int
@@ -747,20 +688,11 @@ rl_read_init_file (filename)
if (*filename == 0)
filename = DEFAULT_INPUTRC;
-#ifdef __MSDOS__
- {
- /* DOS doesn't allow leading dots in file names. If the original
- name fails (it could work if we are on Windows), fall back to
- ~/_inputrc. */
- int retval = _rl_read_init_file (filename, 0);
-
- if (retval == 0)
- return retval;
- else if (strcmp (filename, "~/.inputrc") == 0)
- filename = "~/_inputrc";
- }
+#if defined (__MSDOS__)
+ if (_rl_read_init_file (filename, 0) == 0)
+ return 0;
+ filename = "~/_inputrc";
#endif
-
return (_rl_read_init_file (filename, 0));
}
@@ -789,6 +721,8 @@ _rl_read_init_file (filename, include_level)
last_readline_init_file = savestring (filename);
}
+ currently_reading_init_file = 1;
+
/* Loop over the lines in the file. Lines that start with `#' are
comments; all other lines are commands for readline initialization. */
current_readline_init_lineno = 1;
@@ -799,6 +733,12 @@ _rl_read_init_file (filename, include_level)
/* Find the end of this line. */
for (i = 0; line + i != end && line[i] != '\n'; i++);
+#if defined (__CYGWIN32__)
+ /* ``Be liberal in what you accept.'' */
+ if (line[i] == '\n' && line[i-1] == '\r')
+ line[i - 1] = '\0';
+#endif
+
/* Mark end of line. */
line[i] = '\0';
@@ -819,6 +759,7 @@ _rl_read_init_file (filename, include_level)
}
free (buffer);
+ currently_reading_init_file = 0;
return (0);
}
@@ -826,9 +767,11 @@ static void
_rl_init_file_error (msg)
char *msg;
{
- fprintf (stderr, "readline: %s: line %d: %s\n", current_readline_init_file,
- current_readline_init_lineno,
- msg);
+ if (currently_reading_init_file)
+ fprintf (stderr, "readline: %s: line %d: %s\n", current_readline_init_file,
+ current_readline_init_lineno, msg);
+ else
+ fprintf (stderr, "readline: %s\n", msg);
}
/* **************************************************************** */
@@ -1275,154 +1218,273 @@ rl_parse_and_bind (string)
have one of two values; either "On" or 1 for truth, or "Off" or 0 for
false. */
+#define V_SPECIAL 0x1
+
static struct {
char *name;
int *value;
+ int flags;
} boolean_varlist [] = {
-#if defined (PAREN_MATCHING)
- { "blink-matching-paren", &rl_blink_matching_paren },
-#endif
- { "completion-ignore-case", &_rl_completion_case_fold },
- { "convert-meta", &_rl_convert_meta_chars_to_ascii },
- { "disable-completion", &rl_inhibit_completion },
- { "enable-keypad", &_rl_enable_keypad },
- { "expand-tilde", &rl_complete_with_tilde_expansion },
- { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode },
- { "input-meta", &_rl_meta_flag },
- { "mark-directories", &_rl_complete_mark_directories },
- { "mark-modified-lines", &_rl_mark_modified_lines },
- { "meta-flag", &_rl_meta_flag },
- { "output-meta", &_rl_output_meta_chars },
- { "print-completions-horizontally", &_rl_print_completions_horizontally },
- { "show-all-if-ambiguous", &_rl_complete_show_all },
+ { "blink-matching-paren", &rl_blink_matching_paren, V_SPECIAL },
+ { "completion-ignore-case", &_rl_completion_case_fold, 0 },
+ { "convert-meta", &_rl_convert_meta_chars_to_ascii, 0 },
+ { "disable-completion", &rl_inhibit_completion, 0 },
+ { "enable-keypad", &_rl_enable_keypad, 0 },
+ { "expand-tilde", &rl_complete_with_tilde_expansion, 0 },
+ { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 },
+ { "input-meta", &_rl_meta_flag, 0 },
+ { "mark-directories", &_rl_complete_mark_directories, 0 },
+ { "mark-modified-lines", &_rl_mark_modified_lines, 0 },
+ { "meta-flag", &_rl_meta_flag, 0 },
+ { "output-meta", &_rl_output_meta_chars, 0 },
+ { "prefer-visible-bell", &_rl_prefer_visible_bell, V_SPECIAL },
+ { "print-completions-horizontally", &_rl_print_completions_horizontally, 0 },
+ { "show-all-if-ambiguous", &_rl_complete_show_all, 0 },
#if defined (VISIBLE_STATS)
- { "visible-stats", &rl_visible_stats },
+ { "visible-stats", &rl_visible_stats, 0 },
#endif /* VISIBLE_STATS */
{ (char *)NULL, (int *)NULL }
};
+static int
+find_boolean_var (name)
+ char *name;
+{
+ register int i;
+
+ for (i = 0; boolean_varlist[i].name; i++)
+ if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
+ return i;
+ return -1;
+}
+
+/* Hooks for handling special boolean variables, where a
+ function needs to be called or another variable needs
+ to be changed when they're changed. */
+static void
+hack_special_boolean_var (i)
+ int i;
+{
+ char *name;
+
+ name = boolean_varlist[i].name;
+
+ if (_rl_stricmp (name, "blink-matching-paren") == 0)
+ _rl_enable_paren_matching (rl_blink_matching_paren);
+ else if (_rl_stricmp (name, "prefer-visible-bell") == 0)
+ {
+ if (_rl_prefer_visible_bell)
+ _rl_bell_preference = VISIBLE_BELL;
+ else
+ _rl_bell_preference = AUDIBLE_BELL;
+ }
+}
+
+/* These *must* correspond to the array indices for the appropriate
+ string variable. (Though they're not used right now.) */
+#define V_BELLSTYLE 0
+#define V_COMBEGIN 1
+#define V_EDITMODE 2
+#define V_ISRCHTERM 3
+#define V_KEYMAP 4
+
+#define V_STRING 1
+#define V_INT 2
+
+/* Forward declarations */
+static int sv_bell_style __P((char *));
+static int sv_combegin __P((char *));
+static int sv_compquery __P((char *));
+static int sv_editmode __P((char *));
+static int sv_isrchterm __P((char *));
+static int sv_keymap __P((char *));
+
+static struct {
+ char *name;
+ int flags;
+ Function *set_func;
+} string_varlist[] = {
+ { "bell-style", V_STRING, sv_bell_style },
+ { "comment-begin", V_STRING, sv_combegin },
+ { "completion-query-items", V_INT, sv_compquery },
+ { "editing-mode", V_STRING, sv_editmode },
+ { "isearch-terminators", V_STRING, sv_isrchterm },
+ { "keymap", V_STRING, sv_keymap },
+ { (char *)NULL, 0 }
+};
+
+static int
+find_string_var (name)
+ char *name;
+{
+ register int i;
+
+ for (i = 0; string_varlist[i].name; i++)
+ if (_rl_stricmp (name, string_varlist[i].name) == 0)
+ return i;
+ return -1;
+}
+
+/* A boolean value that can appear in a `set variable' command is true if
+ the value is null or empty, `on' (case-insenstive), or "1". Any other
+ values result in 0 (false). */
+static int
+bool_to_int (value)
+ char *value;
+{
+ return (value == 0 || *value == '\0' ||
+ (_rl_stricmp (value, "on") == 0) ||
+ (value[0] == '1' && value[1] == '\0'));
+}
+
int
rl_variable_bind (name, value)
char *name, *value;
{
register int i;
+ int v;
/* Check for simple variables first. */
- for (i = 0; boolean_varlist[i].name; i++)
+ i = find_boolean_var (name);
+ if (i >= 0)
{
- if (_rl_stricmp (name, boolean_varlist[i].name) == 0)
- {
- /* A variable is TRUE if the "value" is "on", "1" or "". */
- *boolean_varlist[i].value = *value == 0 ||
- _rl_stricmp (value, "on") == 0 ||
- (value[0] == '1' && value[1] == '\0');
- return 0;
- }
+ *boolean_varlist[i].value = bool_to_int (value);
+ if (boolean_varlist[i].flags & V_SPECIAL)
+ hack_special_boolean_var (i);
+ return 0;
}
- /* Not a boolean variable, so check for specials. */
+ i = find_string_var (name);
+
+ /* For the time being, unknown variable names or string names without a
+ handler function are simply ignored. */
+ if (i < 0 || string_varlist[i].set_func == 0)
+ return 0;
+
+ v = (*string_varlist[i].set_func) (value);
+ return v;
+}
- /* Editing mode change? */
- if (_rl_stricmp (name, "editing-mode") == 0)
+static int
+sv_editmode (value)
+ char *value;
+{
+ if (_rl_strnicmp (value, "vi", 2) == 0)
{
- if (_rl_strnicmp (value, "vi", 2) == 0)
- {
#if defined (VI_MODE)
- _rl_keymap = vi_insertion_keymap;
- rl_editing_mode = vi_mode;
+ _rl_keymap = vi_insertion_keymap;
+ rl_editing_mode = vi_mode;
#endif /* VI_MODE */
- }
- else if (_rl_strnicmp (value, "emacs", 5) == 0)
- {
- _rl_keymap = emacs_standard_keymap;
- rl_editing_mode = emacs_mode;
- }
+ return 0;
}
-
- /* Comment string change? */
- else if (_rl_stricmp (name, "comment-begin") == 0)
+ else if (_rl_strnicmp (value, "emacs", 5) == 0)
{
- if (*value)
- {
- if (_rl_comment_begin)
- free (_rl_comment_begin);
-
- _rl_comment_begin = savestring (value);
- }
+ _rl_keymap = emacs_standard_keymap;
+ rl_editing_mode = emacs_mode;
+ return 0;
}
- else if (_rl_stricmp (name, "completion-query-items") == 0)
+ return 1;
+}
+
+static int
+sv_combegin (value)
+ char *value;
+{
+ if (value && *value)
{
- int nval = 100;
- if (*value)
- {
- nval = atoi (value);
- if (nval < 0)
- nval = 0;
- }
- rl_completion_query_items = nval;
+ FREE (_rl_comment_begin);
+ _rl_comment_begin = savestring (value);
+ return 0;
}
- else if (_rl_stricmp (name, "keymap") == 0)
+ return 1;
+}
+
+static int
+sv_compquery (value)
+ char *value;
+{
+ int nval = 100;
+
+ if (value && *value)
{
- Keymap kmap;
- kmap = rl_get_keymap_by_name (value);
- if (kmap)
- rl_set_keymap (kmap);
+ nval = atoi (value);
+ if (nval < 0)
+ nval = 0;
}
- else if (_rl_stricmp (name, "bell-style") == 0)
+ rl_completion_query_items = nval;
+ return 0;
+}
+
+static int
+sv_keymap (value)
+ char *value;
+{
+ Keymap kmap;
+
+ kmap = rl_get_keymap_by_name (value);
+ if (kmap)
{
- if (!*value)
- _rl_bell_preference = AUDIBLE_BELL;
- else
- {
- if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0)
- _rl_bell_preference = NO_BELL;
- else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0)
- _rl_bell_preference = AUDIBLE_BELL;
- else if (_rl_stricmp (value, "visible") == 0)
- _rl_bell_preference = VISIBLE_BELL;
- }
+ rl_set_keymap (kmap);
+ return 0;
}
- else if (_rl_stricmp (name, "prefer-visible-bell") == 0)
+ return 1;
+}
+
+#define _SET_BELL(v) do { _rl_bell_preference = v; return 0; } while (0)
+
+static int
+sv_bell_style (value)
+ char *value;
+{
+ if (value == 0 || *value == '\0')
+ _SET_BELL (AUDIBLE_BELL);
+ else if (_rl_stricmp (value, "none") == 0 || _rl_stricmp (value, "off") == 0)
+ _SET_BELL (NO_BELL);
+ else if (_rl_stricmp (value, "audible") == 0 || _rl_stricmp (value, "on") == 0)
+ _SET_BELL (AUDIBLE_BELL);
+ else if (_rl_stricmp (value, "visible") == 0)
+ _SET_BELL (VISIBLE_BELL);
+ else
+ return 1;
+}
+#undef _SET_BELL
+
+static int
+sv_isrchterm (value)
+ char *value;
+{
+ int beg, end, delim;
+ char *v;
+
+ if (value == 0)
+ return 1;
+
+ /* Isolate the value and translate it into a character string. */
+ v = savestring (value);
+ FREE (_rl_isearch_terminators);
+ if (v[0] == '"' || v[0] == '\'')
{
- /* Backwards compatibility. */
- if (*value && (_rl_stricmp (value, "on") == 0 ||
- (*value == '1' && !value[1])))
- _rl_bell_preference = VISIBLE_BELL;
- else
- _rl_bell_preference = AUDIBLE_BELL;
+ delim = v[0];
+ for (beg = end = 1; v[end] && v[end] != delim; end++)
+ ;
}
- else if (_rl_stricmp (name, "isearch-terminators") == 0)
+ else
{
- /* Isolate the value and translate it into a character string. */
- int beg, end;
- char *v;
+ for (beg = end = 0; whitespace (v[end]) == 0; end++)
+ ;
+ }
- v = savestring (value);
- FREE (_rl_isearch_terminators);
- if (v[0] == '"' || v[0] == '\'')
- {
- int delim = v[0];
- for (beg = end = 1; v[end] && v[end] != delim; end++)
- ;
- }
- else
- {
- for (beg = end = 0; whitespace (v[end]) == 0; end++)
- ;
- }
+ v[end] = '\0';
- v[end] = '\0';
- /* The value starts at v + beg. Translate it into a character string. */
- _rl_isearch_terminators = (unsigned char *)xmalloc (2 * strlen (v) + 1);
- rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end);
- _rl_isearch_terminators[end] = '\0';
- free (v);
- }
-
- /* For the time being, unknown variable names are simply ignored. */
+ /* The value starts at v + beg. Translate it into a character string. */
+ _rl_isearch_terminators = (unsigned char *)xmalloc (2 * strlen (v) + 1);
+ rl_translate_keyseq (v + beg, _rl_isearch_terminators, &end);
+ _rl_isearch_terminators[end] = '\0';
+
+ free (v);
return 0;
}
-
+
/* Return the character which matches NAME.
For example, `Space' returns ' '. */
diff --git a/readline/callback.c b/readline/callback.c
index 6915be483a4..117235697e1 100644
--- a/readline/callback.c
+++ b/readline/callback.c
@@ -7,7 +7,7 @@
The GNU Readline Library 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 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -35,15 +35,7 @@
/* System-specific feature definitions and include files. */
#include "rldefs.h"
#include "readline.h"
-
-extern void readline_internal_setup ();
-extern char *readline_internal_teardown ();
-extern int readline_internal_char ();
-extern void _rl_init_line_state ();
-
-extern int _rl_meta_flag;
-extern char *rl_prompt;
-extern int rl_visible_prompt_length;
+#include "rlprivate.h"
/* **************************************************************** */
/* */
diff --git a/readline/chardefs.h b/readline/chardefs.h
index 3e9e2737706..664c1e43368 100644
--- a/readline/chardefs.h
+++ b/readline/chardefs.h
@@ -7,7 +7,7 @@
The GNU Readline Library 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 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#ifndef _CHARDEFS_H_
#define _CHARDEFS_H_
diff --git a/readline/complete.c b/readline/complete.c
index 1188120f0ab..fb48712a4e0 100644
--- a/readline/complete.c
+++ b/readline/complete.c
@@ -7,7 +7,7 @@
The GNU Readline Library 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 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -70,20 +70,14 @@ extern struct passwd *getpwent ();
/* Some standard library routines. */
#include "readline.h"
+#include "xmalloc.h"
+#include "rlprivate.h"
-extern char *tilde_expand ();
-extern char *rl_copy_text ();
-extern void _rl_abort_internal ();
-extern int _rl_qsort_string_compare ();
-extern void _rl_replace_text ();
-
-extern Function *rl_last_func;
-extern int rl_editing_mode;
-extern int screenwidth;
-
-extern void _rl_move_vert ();
-extern int _rl_vis_botlin;
-extern int rl_display_fixed;
+#ifdef __STDC__
+typedef int QSFUNC (const void *, const void *);
+#else
+typedef int QSFUNC ();
+#endif
/* If non-zero, then this is the address of a function to call when
completing a word would normally display the list of possible matches.
@@ -95,27 +89,25 @@ extern int rl_display_fixed;
VFunction *rl_completion_display_matches_hook = (VFunction *)NULL;
/* Forward declarations for functions defined and used in this file. */
-char *filename_completion_function ();
-char **completion_matches ();
+char *filename_completion_function __P((char *, int));
+char **completion_matches __P((char *, CPFunction *));
#if defined (VISIBLE_STATS)
# if !defined (X_OK)
# define X_OK 1
# endif
-static int stat_char ();
+static int stat_char __P((char *));
#endif
-static char *rl_quote_filename ();
-static char *rl_strpbrk ();
-
-static char **remove_duplicate_matches ();
-static void insert_match ();
-static int append_to_match ();
-static void insert_all_matches ();
-static void display_matches ();
-static int compute_lcd_of_matches ();
+static char *rl_quote_filename __P((char *, int, char *));
+static char *rl_strpbrk __P((char *, char *));
-extern char *xmalloc (), *xrealloc ();
+static char **remove_duplicate_matches __P((char **));
+static void insert_match __P((char *, int, int, char *));
+static int append_to_match __P((char *, int, int));
+static void insert_all_matches __P((char **, int, char *));
+static void display_matches __P((char **));
+static int compute_lcd_of_matches __P((char **, int, char *));
/* **************************************************************** */
/* */
@@ -136,7 +128,11 @@ int _rl_complete_mark_directories = 1;
int _rl_print_completions_horizontally;
/* Non-zero means that case is not significant in filename completion. */
+#if defined (__MSDOS__) && !defined (__DJGPP__)
+int _rl_completion_case_fold = 1;
+#else
int _rl_completion_case_fold;
+#endif
/* Global variables available to applications using readline. */
@@ -417,6 +413,10 @@ printable_part (pathname)
char *temp;
temp = rl_filename_completion_desired ? strrchr (pathname, '/') : (char *)NULL;
+#if defined (__MSDOS__)
+ if (rl_filename_completion_desired && temp == 0 && isalpha (pathname[0]) && pathname[1] == ':')
+ temp = pathname + 1;
+#endif
return (temp ? ++temp : pathname);
}
@@ -477,7 +477,12 @@ print_filename (to_print, full_pathname)
c = to_print[-1];
to_print[-1] = '\0';
- s = tilde_expand (full_pathname);
+ /* If setting the last slash in full_pathname to a NUL results in
+ full_pathname being the empty string, we are trying to complete
+ files in the root directory. If we pass a null string to the
+ bash directory completion hook, for example, it will expand it
+ to the current directory. We just want the `/'. */
+ s = tilde_expand (full_pathname && *full_pathname ? full_pathname : "/");
if (rl_directory_completion_hook)
(*rl_directory_completion_hook) (&s);
@@ -627,25 +632,31 @@ find_completion_word (fp, dp)
/* If there is an application-specific function to say whether or not
a character is quoted and we found a quote character, let that
function decide whether or not a character is a word break, even
- if it is found in rl_completer_word_break_characters. */
- if (rl_char_is_quoted_p)
- isbrk = (found_quote == 0 ||
- (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) &&
- strchr (rl_completer_word_break_characters, scan) != 0;
- else
- isbrk = strchr (rl_completer_word_break_characters, scan) != 0;
-
- if (isbrk)
+ if it is found in rl_completer_word_break_characters. Don't bother
+ if we're at the end of the line, though. */
+ if (scan)
{
- /* If the character that caused the word break was a quoting
- character, then remember it as the delimiter. */
- if (rl_basic_quote_characters && strchr (rl_basic_quote_characters, scan) && (end - rl_point) > 1)
- delimiter = scan;
-
- /* If the character isn't needed to determine something special
- about what kind of completion to perform, then advance past it. */
- if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0)
- rl_point++;
+ if (rl_char_is_quoted_p)
+ isbrk = (found_quote == 0 ||
+ (*rl_char_is_quoted_p) (rl_line_buffer, rl_point) == 0) &&
+ strchr (rl_completer_word_break_characters, scan) != 0;
+ else
+ isbrk = strchr (rl_completer_word_break_characters, scan) != 0;
+
+ if (isbrk)
+ {
+ /* If the character that caused the word break was a quoting
+ character, then remember it as the delimiter. */
+ if (rl_basic_quote_characters &&
+ strchr (rl_basic_quote_characters, scan) &&
+ (end - rl_point) > 1)
+ delimiter = scan;
+
+ /* If the character isn't needed to determine something special
+ about what kind of completion to perform, then advance past it. */
+ if (rl_special_prefixes == 0 || strchr (rl_special_prefixes, scan) == 0)
+ rl_point++;
+ }
}
if (fp)
@@ -715,7 +726,7 @@ remove_duplicate_matches (matches)
/* Sort the array without matches[0], since we need it to
stay in place no matter what. */
if (i)
- qsort (matches+1, i-1, sizeof (char *), _rl_qsort_string_compare);
+ qsort (matches+1, i-1, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
/* Remember the lowest common denominator for it may be unique. */
lowest_common = savestring (matches[0]);
@@ -908,7 +919,7 @@ rl_display_match_list (matches, len, max)
/* Sort the items if they are not already sorted. */
if (rl_ignore_completion_duplicates == 0)
- qsort (matches + 1, len, sizeof (char *), _rl_qsort_string_compare);
+ qsort (matches + 1, len, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
crlf ();
@@ -1409,7 +1420,7 @@ username_completion_function (text, state)
{
#if defined (__WIN32__) || defined (__OPENNT)
return (char *)NULL;
-#else /* !__WIN32__ && !__OPENNT */
+#else /* !__WIN32__ && !__OPENNT) */
static char *username = (char *)NULL;
static struct passwd *entry;
static int namelen, first_char, first_char_loc;
@@ -1452,7 +1463,7 @@ username_completion_function (text, state)
return (value);
}
-#endif /* !__GO32__ */
+#endif /* !__WIN32__ && !__OPENNT */
}
/* Okay, now we write the entry_function for filename completion. In the
@@ -1494,18 +1505,24 @@ filename_completion_function (text, state)
temp = strrchr (dirname, '/');
+#if defined (__MSDOS__)
+ /* special hack for //X/... */
+ if (dirname[0] == '/' && dirname[1] == '/' && isalpha (dirname[2]) && dirname[3] == '/')
+ temp = strrchr (dirname + 3, '/');
+#endif
+
if (temp)
{
strcpy (filename, ++temp);
*temp = '\0';
}
-#if defined (__WIN32__) || defined (__OPENNT) || defined (__MSDOS__)
- /* Handle the drive-relative names "d:foo/bar". */
- else if (dirname[1] == ':')
- {
- strcpy (filename, dirname + 2);
- dirname[2] = '\0';
- }
+#if defined (__MSDOS__)
+ /* searches from current directory on the drive */
+ else if (isalpha (dirname[0]) && dirname[1] == ':')
+ {
+ strcpy (filename, dirname + 2);
+ dirname[2] = '\0';
+ }
#endif
else
{
@@ -1668,11 +1685,7 @@ rl_menu_complete (count, ignore)
/* Clean up from previous call, if any. */
FREE (orig_text);
if (matches)
- {
- for (match_list_index = 0; matches[match_list_index]; match_list_index++)
- free (matches[match_list_index]);
- free (matches);
- }
+ free_match_list (matches);
match_list_index = match_list_size = 0;
matches = (char **)NULL;
diff --git a/readline/config.h.in b/readline/config.h.in
index 87f807fa6eb..569e53d271a 100644
--- a/readline/config.h.in
+++ b/readline/config.h.in
@@ -57,6 +57,9 @@
/* Define if you have the lstat function. */
#undef HAVE_LSTAT
+/* Define if you have the memmove function. */
+#undef HAVE_MEMMOVE
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
diff --git a/readline/configure b/readline/configure
index cdcdf88bae4..ae9bf942bcc 100755
--- a/readline/configure
+++ b/readline/configure
@@ -1,7 +1,19 @@
#! /bin/sh
-# From configure.in for Readline 4.0, version 2.14, from autoconf version 2.13
-LIBVERSION=4.0
+# From configure.in for Readline 4.1, version 2.22, from autoconf version 2.13
+LIBVERSION=4.1
+
+
+
+
+
+
+
+
+
+
+
+
@@ -121,7 +133,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -236,7 +247,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -407,11 +417,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -577,16 +582,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -656,7 +657,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:660: checking host system type" >&5
+echo "configure:661: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -697,7 +698,7 @@ test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:701: checking for $ac_word" >&5
+echo "configure:702: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -727,7 +728,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:731: checking for $ac_word" >&5
+echo "configure:732: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -778,7 +779,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:782: checking for $ac_word" >&5
+echo "configure:783: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -810,7 +811,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -821,12 +822,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 825 "configure"
+#line 826 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -852,12 +853,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:856: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:857: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:861: checking whether we are using GNU C" >&5
+echo "configure:862: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -866,7 +867,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -885,7 +886,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:889: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:890: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -917,7 +918,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:921: checking how to run the C preprocessor" >&5
+echo "configure:922: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -932,13 +933,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -949,13 +950,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -966,13 +967,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -998,17 +999,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1002: checking for minix/config.h" >&5
+echo "configure:1003: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1085,13 +1086,13 @@ test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1089: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1090: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <
Autoconf TIOCGETP
@@ -1109,7 +1110,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <
Autoconf TCGETA
@@ -1142,7 +1143,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1146: checking for a BSD compatible install" >&5
+echo "configure:1147: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1197,7 +1198,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1201: checking for $ac_word" >&5
+echo "configure:1202: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1227,7 +1228,7 @@ test -n "$ARFLAGS" || ARFLAGS="cr"
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1231: checking for $ac_word" >&5
+echo "configure:1232: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1259,12 +1260,12 @@ MAKE_SHELL=/bin/sh
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1263: checking return type of signal handlers" >&5
+echo "configure:1264: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1281,7 +1282,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1301,12 +1302,12 @@ EOF
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1305: checking whether stat file-mode macros are broken" >&5
+echo "configure:1306: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1361,12 +1362,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1365: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1366: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include <$ac_hdr>
@@ -1374,7 +1375,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1399,7 +1400,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1403: checking for opendir in -ldir" >&5
+echo "configure:1404: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1407,7 +1408,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1440,7 +1441,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1444: checking for opendir in -lx" >&5
+echo "configure:1445: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1448,7 +1449,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1482,15 +1483,16 @@ fi
fi
-for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat
+for ac_func in lstat memmove putenv select setenv setlocale \
+ strcasecmp tcgetattr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1489: checking for $ac_func" >&5
+echo "configure:1491: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1539,7 +1541,7 @@ done
echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:1543: checking for working strcoll" >&5
+echo "configure:1545: checking for working strcoll" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1547,7 +1549,7 @@ else
ac_cv_func_strcoll_works=no
else
cat > conftest.$ac_ext <
main ()
@@ -1557,7 +1559,7 @@ main ()
strcoll ("123", "456") >= 0);
}
EOF
-if { (eval echo configure:1561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strcoll_works=yes
else
@@ -1586,17 +1588,17 @@ for ac_hdr in unistd.h stdlib.h varargs.h stdarg.h string.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1590: checking for $ac_hdr" >&5
+echo "configure:1592: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1625,13 +1627,13 @@ done
echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
-echo "configure:1629: checking for type of signal functions" >&5
+echo "configure:1631: checking for type of signal functions" >&5
if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
int main() {
@@ -1644,7 +1646,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=posix
else
@@ -1653,7 +1655,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <
int main() {
@@ -1663,7 +1665,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=4.2bsd
else
@@ -1672,7 +1674,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <
@@ -1685,7 +1687,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:1689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_signal_vintage=svr3
else
@@ -1726,7 +1728,7 @@ fi
echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
-echo "configure:1730: checking if signal handlers must be reinstalled when invoked" >&5
+echo "configure:1732: checking if signal handlers must be reinstalled when invoked" >&5
if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1736,7 +1738,7 @@ else
else
cat > conftest.$ac_ext <
@@ -1783,7 +1785,7 @@ main()
}
EOF
-if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_must_reinstall_sighandlers=no
else
@@ -1808,7 +1810,7 @@ fi
echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
-echo "configure:1812: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
+echo "configure:1814: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1818,7 +1820,7 @@ else
else
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_sigsetjmp=present
else
@@ -1882,12 +1884,12 @@ EOF
fi
echo $ac_n "checking for lstat""... $ac_c" 1>&6
-echo "configure:1886: checking for lstat" >&5
+echo "configure:1888: checking for lstat" >&5
if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
@@ -1897,7 +1899,7 @@ int main() {
lstat(".",(struct stat *)0);
; return 0; }
EOF
-if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
bash_cv_func_lstat=yes
else
@@ -1918,12 +1920,12 @@ EOF
fi
echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
-echo "configure:1922: checking whether programs are able to redeclare getpw functions" >&5
+echo "configure:1924: checking whether programs are able to redeclare getpw functions" >&5
if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -1934,7 +1936,7 @@ int main() {
struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
; return 0; }
EOF
-if { (eval echo configure:1938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_can_redecl_getpw=yes
else
@@ -1956,7 +1958,7 @@ fi
echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
-echo "configure:1960: checking whether or not strcoll and strcmp differ" >&5
+echo "configure:1962: checking whether or not strcoll and strcmp differ" >&5
if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1966,7 +1968,7 @@ else
else
cat > conftest.$ac_ext <
@@ -2005,7 +2007,7 @@ char *v[];
}
EOF
-if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
bash_cv_func_strcoll_broken=yes
else
@@ -2029,12 +2031,12 @@ fi
echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
-echo "configure:2033: checking whether signal handlers are of type void" >&5
+echo "configure:2035: checking whether signal handlers are of type void" >&5
if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2049,7 +2051,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_void_sighandler=yes
else
@@ -2069,12 +2071,12 @@ EOF
fi
echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2073: checking for TIOCGWINSZ in sys/ioctl.h" >&5
+echo "configure:2075: checking for TIOCGWINSZ in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2082,7 +2084,7 @@ int main() {
int x = TIOCGWINSZ;
; return 0; }
EOF
-if { (eval echo configure:2086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocgwinsz_in_ioctl=yes
else
@@ -2103,12 +2105,12 @@ EOF
fi
echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2107: checking for TIOCSTAT in sys/ioctl.h" >&5
+echo "configure:2109: checking for TIOCSTAT in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2116,7 +2118,7 @@ int main() {
int x = TIOCSTAT;
; return 0; }
EOF
-if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_tiocstat_in_ioctl=yes
else
@@ -2137,12 +2139,12 @@ EOF
fi
echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
-echo "configure:2141: checking for FIONREAD in sys/ioctl.h" >&5
+echo "configure:2143: checking for FIONREAD in sys/ioctl.h" >&5
if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2150,7 +2152,7 @@ int main() {
int x = FIONREAD;
; return 0; }
EOF
-if { (eval echo configure:2154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_fionread_in_ioctl=yes
else
@@ -2171,19 +2173,19 @@ EOF
fi
echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2175: checking for speed_t in sys/types.h" >&5
+echo "configure:2177: checking for speed_t in sys/types.h" >&5
if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
int main() {
speed_t x;
; return 0; }
EOF
-if { (eval echo configure:2187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_speed_t_in_sys_types=yes
else
@@ -2204,12 +2206,12 @@ EOF
fi
echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
-echo "configure:2208: checking for struct winsize in sys/ioctl.h and termios.h" >&5
+echo "configure:2210: checking for struct winsize in sys/ioctl.h and termios.h" >&5
if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
#include
@@ -2217,7 +2219,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=ioctl_h
else
@@ -2225,7 +2227,7 @@ else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <
#include
@@ -2233,7 +2235,7 @@ int main() {
struct winsize x;
; return 0; }
EOF
-if { (eval echo configure:2237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_struct_winsize_header=termios_h
else
@@ -2266,12 +2268,12 @@ fi
echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
-echo "configure:2270: checking if struct dirent has a d_ino member" >&5
+echo "configure:2272: checking if struct dirent has a d_ino member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
@@ -2300,7 +2302,7 @@ struct dirent d; int z; z = d.d_ino;
; return 0; }
EOF
-if { (eval echo configure:2304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_dino=yes
else
@@ -2322,12 +2324,12 @@ fi
echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
-echo "configure:2326: checking if struct dirent has a d_fileno member" >&5
+echo "configure:2328: checking if struct dirent has a d_fileno member" >&5
if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <
@@ -2356,7 +2358,7 @@ struct dirent d; int z; z = d.d_fileno;
; return 0; }
EOF
-if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bash_cv_dirent_has_d_fileno=yes
else
@@ -2385,14 +2387,14 @@ if test "X$bash_cv_termcap_lib" = "X"; then
_bash_needmsg=yes
else
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2389: checking which library has the termcap functions" >&5
+echo "configure:2391: checking which library has the termcap functions" >&5
_bash_needmsg=
fi
if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:2396: checking for tgetent in -ltermcap" >&5
+echo "configure:2398: checking for tgetent in -ltermcap" >&5
ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2400,7 +2402,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2430,7 +2432,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:2434: checking for tgetent in -lcurses" >&5
+echo "configure:2436: checking for tgetent in -lcurses" >&5
ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2438,7 +2440,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2468,7 +2470,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:2472: checking for tgetent in -lncurses" >&5
+echo "configure:2474: checking for tgetent in -lncurses" >&5
ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2476,7 +2478,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2516,7 +2518,7 @@ fi
if test "X$_bash_needmsg" = "Xyes"; then
echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
-echo "configure:2520: checking which library has the termcap functions" >&5
+echo "configure:2522: checking which library has the termcap functions" >&5
fi
echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
@@ -2553,8 +2555,8 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
echo $ac_n "checking configuration for building shared libraries""... $ac_c" 1>&6
-echo "configure:2557: checking configuration for building shared libraries" >&5
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+echo "configure:2559: checking configuration for building shared libraries" >&5
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
@@ -2568,9 +2570,20 @@ echo "configure:2557: checking configuration for building shared libraries" >&5
echo "$ac_t""$SHLIB_STATUS" 1>&6
+
+ # shared library versioning
+ # quoted for m4 so I can use character classes
+ SHLIB_MAJOR=`expr "$LIBVERSION" : '\([0-9]\)\..*'`
+ SHLIB_MINOR=`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`
+
+
fi
-BUILD_DIR=`pwd`
+case "$host_os" in
+msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
+*) BUILD_DIR=`pwd` ;;
+esac
+
@@ -2748,6 +2761,8 @@ s%@SHLIB_XLDFLAGS@%$SHLIB_XLDFLAGS%g
s%@SHLIB_LIBSUFF@%$SHLIB_LIBSUFF%g
s%@SHLIB_LIBVERSION@%$SHLIB_LIBVERSION%g
s%@SHLIB_LIBS@%$SHLIB_LIBS%g
+s%@SHLIB_MAJOR@%$SHLIB_MAJOR%g
+s%@SHLIB_MINOR@%$SHLIB_MINOR%g
s%@BUILD_DIR@%$BUILD_DIR%g
s%@LOCAL_CFLAGS@%$LOCAL_CFLAGS%g
s%@LOCAL_LDFLAGS@%$LOCAL_LDFLAGS%g
diff --git a/readline/configure.in b/readline/configure.in
index 9afdaa70fcf..780b4df6284 100644
--- a/readline/configure.in
+++ b/readline/configure.in
@@ -4,8 +4,8 @@ dnl
dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
-AC_REVISION([for Readline 4.0, version 2.14, from autoconf version] AC_ACVERSION)
-LIBVERSION=4.0
+AC_REVISION([for Readline 4.1, version 2.22, from autoconf version] AC_ACVERSION)
+LIBVERSION=4.1
AC_INIT(readline.h)
AC_CONFIG_HEADER(config.h)
@@ -32,6 +32,7 @@ fi
test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
AC_PROG_CC
+dnl AC_AIX
AC_MINIX
dnl BEGIN changes for CYGNUS cross-building for Cygwin
@@ -91,7 +92,8 @@ AC_RETSIGTYPE
AC_HEADER_STAT
AC_HEADER_DIRENT
-AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat)
+AC_CHECK_FUNCS(lstat memmove putenv select setenv setlocale \
+ strcasecmp tcgetattr)
AC_FUNC_STRCOLL
@@ -140,7 +142,7 @@ esac
#
if test -f ${srcdir}/support/shobj-conf; then
AC_MSG_CHECKING(configuration for building shared libraries)
- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C ${CC} -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
AC_SUBST(SHOBJ_LD)
@@ -154,9 +156,20 @@ if test -f ${srcdir}/support/shobj-conf; then
AC_SUBST(SHLIB_LIBVERSION)
AC_SUBST(SHLIB_LIBS)
AC_MSG_RESULT($SHLIB_STATUS)
+
+ # shared library versioning
+ # quoted for m4 so I can use character classes
+ SHLIB_MAJOR=[`expr "$LIBVERSION" : '\([0-9]\)\..*'`]
+ SHLIB_MINOR=[`expr "$LIBVERSION" : '[0-9]\.\([0-9]\).*'`]
+ AC_SUBST(SHLIB_MAJOR)
+ AC_SUBST(SHLIB_MINOR)
fi
-BUILD_DIR=`pwd`
+case "$host_os" in
+msdosdjgpp*) BUILD_DIR=`pwd.exe` ;; # to prevent //d/path/file
+*) BUILD_DIR=`pwd` ;;
+esac
+
AC_SUBST(BUILD_DIR)
AC_SUBST(CFLAGS)
diff --git a/readline/display.c b/readline/display.c
index 3215a94cd1b..4487004a027 100644
--- a/readline/display.c
+++ b/readline/display.c
@@ -7,7 +7,7 @@
The GNU Readline Library 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 1, or
+ as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
The GNU Readline Library is distributed in the hope that it will be
@@ -18,7 +18,7 @@
The GNU General Public License is often shipped with GNU software, and
is generally kept in a file called COPYING or LICENSE. If you do not
have a copy of the license, write to the Free Software Foundation,
- 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
@@ -41,11 +41,6 @@
#include
-#if defined (__GO32__)
-# include
-# include
-#endif /* __GO32__ */
-
/* System-specific feature definitions and include files. */
#include "rldefs.h"
@@ -56,48 +51,25 @@
#include "readline.h"
#include "history.h"
+#include "rlprivate.h"
+#include "xmalloc.h"
+
#if !defined (strchr) && !defined (__STDC__)
extern char *strchr (), *strrchr ();
#endif /* !strchr && !__STDC__ */
-/* Global and pseudo-global variables and functions
- imported from readline.c. */
-extern char *rl_prompt;
-extern int readline_echoing_p;
-
-extern int _rl_output_meta_chars;
-extern int _rl_horizontal_scroll_mode;
-extern int _rl_mark_modified_lines;
-extern int _rl_prefer_visible_bell;
-
-/* Variables and functions imported from terminal.c */
-extern void _rl_output_some_chars ();
-#ifdef _MINIX
-extern void _rl_output_character_function ();
-#else
-extern int _rl_output_character_function ();
+#if defined (HACK_TERMCAP_MOTION)
+extern char *term_forward_char;
#endif
-extern int _rl_backspace ();
-
-extern char *term_clreol, *term_clrpag;
-extern char *term_im, *term_ic, *term_ei, *term_DC;
-extern char *term_up, *term_dc, *term_cr, *term_IC;
-extern int screenheight, screenwidth, screenchars;
-extern int terminal_can_insert, _rl_term_autowrap;
-/* Pseudo-global functions (local to the readline library) exported
- by this file. */
-void _rl_move_cursor_relative (), _rl_output_some_chars ();
-void _rl_move_vert ();
-void _rl_clear_to_eol (), _rl_clear_screen ();
-
-static void update_line (), space_to_eol ();
-static void delete_chars (), insert_some_chars ();
-static void cr ();
+static void update_line __P((char *, char *, int, int, int, int));
+static void space_to_eol __P((int));
+static void delete_chars __P((int));
+static void insert_some_chars __P((char *, int));
+static void cr __P((void));
static int *inv_lbreaks, *vis_lbreaks;
-
-extern char *xmalloc (), *xrealloc ();
+static int inv_lbsize, vis_lbsize;
/* Heuristic used to decide whether it is faster to move from CUR to NEW
by backing up or outputting a carriage return and moving forward. */
@@ -190,7 +162,7 @@ static int visible_first_line_len;
/* Expand the prompt string S and return the number of visible
characters in *LP, if LP is not null. This is currently more-or-less
a placeholder for expansion. LIP, if non-null is a place to store the
- index of the last invisible character in ther eturned string. */
+ index of the last invisible character in the returned string. */
/* Current implementation:
\001 (^A) start non-visible characters
@@ -250,6 +222,18 @@ expand_prompt (pmt, lp, lip)
return ret;
}
+/* Just strip out RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE from
+ PMT and return the rest of PMT. */
+char *
+_rl_strip_prompt (pmt)
+ char *pmt;
+{
+ char *ret;
+
+ ret = expand_prompt (pmt, (int *)NULL, (int *)NULL);
+ return ret;
+}
+
/*
* Expand the prompt string into the various display components, if
* necessary.
@@ -307,6 +291,49 @@ rl_expand_prompt (prompt)
}
}
+/* Initialize the VISIBLE_LINE and INVISIBLE_LINE arrays, and their associated
+ arrays of line break markers. MINSIZE is the minimum size of VISIBLE_LINE
+ and INVISIBLE_LINE; if it is greater than LINE_SIZE, LINE_SIZE is
+ increased. If the lines have already been allocated, this ensures that
+ they can hold at least MINSIZE characters. */
+static void
+init_line_structures (minsize)
+ int minsize;
+{
+ register int n;
+
+ if (invisible_line == 0) /* initialize it */
+ {
+ if (line_size < minsize)
+ line_size = minsize;
+ visible_line = xmalloc (line_size);
+ invisible_line = xmalloc (line_size);
+ }
+ else if (line_size < minsize) /* ensure it can hold MINSIZE chars */
+ {
+ line_size *= 2;
+ if (line_size < minsize)
+ line_size = minsize;
+ visible_line = xrealloc (visible_line, line_size);
+ invisible_line = xrealloc (invisible_line, line_size);
+ }
+
+ for (n = minsize; n < line_size; n++)
+ {
+ visible_line[n] = 0;
+ invisible_line[n] = 1;
+ }
+
+ if (vis_lbreaks == 0)
+ {
+ /* should be enough. */
+ inv_lbsize = vis_lbsize = 256;
+ inv_lbreaks = (int *)xmalloc (inv_lbsize * sizeof (int));
+ vis_lbreaks = (int *)xmalloc (vis_lbsize * sizeof (int));
+ inv_lbreaks[0] = vis_lbreaks[0] = 0;
+ }
+}
+
/* Basic redisplay algorithm. */
void
rl_redisplay ()
@@ -325,19 +352,7 @@ rl_redisplay ()
if (invisible_line == 0)
{
- visible_line = xmalloc (line_size);
- invisible_line = xmalloc (line_size);
- for (in = 0; in < line_size; in++)
- {
- visible_line[in] = 0;
- invisible_line[in] = 1;
- }
-
- /* should be enough, but then again, this is just for testing. */
- inv_lbreaks = (int *)malloc (256 * sizeof (int));
- vis_lbreaks = (int *)malloc (256 * sizeof (int));
- inv_lbreaks[0] = vis_lbreaks[0] = 0;
-
+ init_line_structures (0);
rl_on_new_line ();
}
@@ -395,12 +410,13 @@ rl_redisplay ()
else
{
prompt_this_line++;
+ pmtlen = prompt_this_line - rl_display_prompt; /* temp var */
if (forced_display)
{
- _rl_output_some_chars (rl_display_prompt, prompt_this_line - rl_display_prompt);
+ _rl_output_some_chars (rl_display_prompt, pmtlen);
/* Make sure we are at column zero even after a newline,
regardless of the state of terminal output processing. */
- if (prompt_this_line[-2] != '\r')
+ if (pmtlen < 2 || prompt_this_line[-2] != '\r')
cr ();
}
}
@@ -419,11 +435,25 @@ rl_redisplay ()
wrap_offset = 0;
}
+#define CHECK_INV_LBREAKS() \
+ do { \
+ if (newlines >= (inv_lbsize - 2)) \
+ { \
+ inv_lbsize *= 2; \
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ } \
+ } while (0)
+
#define CHECK_LPOS() \
do { \
lpos++; \
if (lpos >= screenwidth) \
{ \
+ if (newlines >= (inv_lbsize - 2)) \
+ { \
+ inv_lbsize *= 2; \
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
+ } \
inv_lbreaks[++newlines] = out; \
lpos = 0; \
} \
@@ -437,14 +467,13 @@ rl_redisplay ()
contents of the command line? */
while (lpos >= screenwidth)
{
-#if 0
- temp = ((newlines + 1) * screenwidth) - ((newlines == 0) ? wrap_offset : 0);
-#else
/* XXX - possible fix from Darin Johnson for prompt
string with invisible characters that is longer than the screen
- width. */
+ width. XXX - this doesn't work right if invisible characters have
+ to be put on the second screen line -- it adds too much (the number
+ of invisible chars after the screenwidth). */
temp = ((newlines + 1) * screenwidth) + ((newlines == 0) ? wrap_offset : 0);
-#endif
+
inv_lbreaks[++newlines] = temp;
lpos -= screenwidth;
}
@@ -477,6 +506,7 @@ rl_redisplay ()
if (lpos + 4 >= screenwidth)
{
temp = screenwidth - lpos;
+ CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out + temp;
lpos = 4 - temp;
}
@@ -506,6 +536,7 @@ rl_redisplay ()
{
register int temp2;
temp2 = screenwidth - lpos;
+ CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out + temp2;
lpos = temp - temp2;
while (out < newout)
@@ -522,6 +553,7 @@ rl_redisplay ()
else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
{
line[out++] = '\0'; /* XXX - sentinel */
+ CHECK_INV_LBREAKS ();
inv_lbreaks[++newlines] = out;
lpos = 0;
}
@@ -546,6 +578,7 @@ rl_redisplay ()
}
inv_botlin = lb_botlin = newlines;
+ CHECK_INV_LBREAKS ();
inv_lbreaks[newlines+1] = out;
cursor_linenum = lb_linenum;
@@ -776,11 +809,17 @@ rl_redisplay ()
/* Swap visible and non-visible lines. */
{
char *temp = visible_line;
- int *itemp = vis_lbreaks;
+ int *itemp = vis_lbreaks, ntemp = vis_lbsize;
+
visible_line = invisible_line;
invisible_line = temp;
+
vis_lbreaks = inv_lbreaks;
inv_lbreaks = itemp;
+
+ vis_lbsize = inv_lbsize;
+ inv_lbsize = ntemp;
+
rl_display_fixed = 0;
/* If we are displaying on a single line, and last_lmargin is > 0, we
are not displaying any invisible characters, so set visible_wrap_offset
@@ -907,7 +946,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif /* !__MSDOS__ */
+#endif
_rl_output_some_chars (local_prompt, lendiff);
_rl_last_c_pos = lendiff;
}
@@ -1037,6 +1076,58 @@ rl_on_new_line ()
return 0;
}
+/* Tell the update routines that we have moved onto a new line with the
+ prompt already displayed. Code originally from the version of readline
+ distributed with CLISP. */
+int
+rl_on_new_line_with_prompt ()
+{
+ int prompt_size, i, l, real_screenwidth, newlines;
+ char *prompt_last_line;
+
+ /* Initialize visible_line and invisible_line to ensure that they can hold
+ the already-displayed prompt. */
+ prompt_size = strlen (rl_prompt) + 1;
+ init_line_structures (prompt_size);
+
+ /* Make sure the line structures hold the already-displayed prompt for
+ redisplay. */
+ strcpy (visible_line, rl_prompt);
+ strcpy (invisible_line, rl_prompt);
+
+ /* If the prompt contains newlines, take the last tail. */
+ prompt_last_line = strrchr (rl_prompt, '\n');
+ if (!prompt_last_line)
+ prompt_last_line = rl_prompt;
+
+ l = strlen (prompt_last_line);
+ _rl_last_c_pos = l;
+
+ /* Dissect prompt_last_line into screen lines. Note that here we have
+ to use the real screenwidth. Readline's notion of screenwidth might be
+ one less, see terminal.c. */
+ real_screenwidth = screenwidth + (_rl_term_autowrap ? 0 : 1);
+ _rl_last_v_pos = l / real_screenwidth;
+ /* If the prompt length is a multiple of real_screenwidth, we don't know
+ whether the cursor is at the end of the last line, or already at the
+ beginning of the next line. Output a newline just to be safe. */
+ if (l > 0 && (l % real_screenwidth) == 0)
+ _rl_output_some_chars ("\n", 1);
+ last_lmargin = 0;
+
+ newlines = 0; i = 0;
+ while (i <= l)
+ {
+ _rl_vis_botlin = newlines;
+ vis_lbreaks[newlines++] = i;
+ i += real_screenwidth;
+ }
+ vis_lbreaks[newlines] = l;
+ visible_wrap_offset = 0;
+
+ return 0;
+}
+
/* Actually update the display, period. */
int
rl_forced_update_display ()
@@ -1094,8 +1185,6 @@ _rl_move_cursor_relative (new, data)
That kind of control is for people who don't know what the
data is underneath the cursor. */
#if defined (HACK_TERMCAP_MOTION)
- extern char *term_forward_char;
-
if (term_forward_char)
for (i = _rl_last_c_pos; i < new; i++)
tputs (term_forward_char, 1, _rl_output_character_function);
@@ -1122,22 +1211,15 @@ _rl_move_vert (to)
if (_rl_last_v_pos == to || to > screenheight)
return;
-#if defined (__GO32__)
- {
- int row, col;
-
- i = fflush (rl_outstream); /* make sure the cursor pos is current! */
- ScreenGetCursor (&row, &col);
- ScreenSetCursor ((row + to - _rl_last_v_pos), col);
- delta = i;
- }
-#else /* !__GO32__ */
-
if ((delta = to - _rl_last_v_pos) > 0)
{
for (i = 0; i < delta; i++)
putc ('\n', rl_outstream);
+#if defined (__MSDOS__)
+ putc ('\r', rl_outstream);
+#else
tputs (term_cr, 1, _rl_output_character_function);
+#endif
_rl_last_c_pos = 0;
}
else
@@ -1146,7 +1228,7 @@ _rl_move_vert (to)
for (i = 0; i < -delta; i++)
tputs (term_up, 1, _rl_output_character_function);
}
-#endif /* !__GO32__ */
+
_rl_last_v_pos = to; /* Now TO is here */
}
@@ -1354,11 +1436,9 @@ void
_rl_clear_to_eol (count)
int count;
{
-#if !defined (__GO32__)
if (term_clreol)
tputs (term_clreol, 1, _rl_output_character_function);
else if (count)
-#endif /* !__GO32__ */
space_to_eol (count);
}
@@ -1379,14 +1459,9 @@ space_to_eol (count)
void
_rl_clear_screen ()
{
-#if defined (__GO32__)
- ScreenClear (); /* FIXME: only works in text modes */
- ScreenSetCursor (0, 0); /* term_clrpag is "cl" which homes the cursor */
-#else
if (term_clrpag)
tputs (term_clrpag, 1, _rl_output_character_function);
else
-#endif /* !__GO32__ */
crlf ();
}
@@ -1396,21 +1471,6 @@ insert_some_chars (string, count)
char *string;
int count;
{
-#if defined (__GO32__)
-#ifndef __DJGPP__
- int row, col, width;
- char *row_start;
-
- ScreenGetCursor (&row, &col);
- width = ScreenCols ();
- row_start = ScreenPrimary + (row * width);
-
- memcpy (row_start + col + count, row_start + col, width - col - count);
-#endif /* !__DJGPP__ */
- /* Place the text on the screen. */
- _rl_output_some_chars (string, count);
-#else /* !_GO32 */
-
/* If IC is defined, then we do not have to "enter" insert mode. */
if (term_IC)
{
@@ -1443,7 +1503,6 @@ insert_some_chars (string, count)
if (term_ei && *term_ei)
tputs (term_ei, 1, _rl_output_character_function);
}
-#endif /* !__GO32__ */
}
/* Delete COUNT characters from the display line. */
@@ -1451,19 +1510,6 @@ static void
delete_chars (count)
int count;
{
-#if !defined (__DJGPP__)
-#if defined (__GO32__)
- int row, col, width;
- char *row_start;
-
- ScreenGetCursor (&row, &col);
- width = ScreenCols ();
- row_start = ScreenPrimary + (row * width);
-
- memcpy (row_start + col, row_start + col + count, width - col - count);
- memset (row_start + width - count, 0, count * 2);
-#else /* !_GO32 */
-
if (count > screenwidth) /* XXX */
return;
@@ -1479,8 +1525,6 @@ delete_chars (count)
while (count--)
tputs (term_dc, 1, _rl_output_character_function);
}
-#endif /* !__GO32__ */
-#endif /* !__DJGPP__ */
}
void
@@ -1502,7 +1546,11 @@ _rl_update_final ()
if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == screenwidth))
{
char *last_line;
+#if 0
last_line = &visible_line[inv_lbreaks[_rl_vis_botlin]];
+#else
+ last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]];
+#endif
_rl_move_cursor_relative (screenwidth - 1, last_line);
_rl_clear_to_eol (0);
putc (last_line[screenwidth - 1], rl_outstream);
@@ -1523,16 +1571,47 @@ cr ()
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif /* !__MSDOS__ */
+#endif
_rl_last_c_pos = 0;
}
}
+/* Redraw the last line of a multi-line prompt that may possibly contain
+ terminal escape sequences. Called with the cursor at column 0 of the
+ line to draw the prompt on. */
+static void
+redraw_prompt (t)
+ char *t;
+{
+ char *oldp, *oldl, *oldlprefix;
+ int oldlen, oldlast, oldplen;
+
+ /* Geez, I should make this a struct. */
+ oldp = rl_display_prompt;
+ oldl = local_prompt;
+ oldlprefix = local_prompt_prefix;
+ oldlen = visible_length;
+ oldplen = prefix_length;
+ oldlast = last_invisible;
+
+ rl_display_prompt = t;
+ local_prompt = expand_prompt (t, &visible_length, &last_invisible);
+ local_prompt_prefix = (char *)NULL;
+ rl_forced_update_display ();
+
+ rl_display_prompt = oldp;
+ local_prompt = oldl;
+ local_prompt_prefix = oldlprefix;
+ visible_length = oldlen;
+ prefix_length = oldplen;
+ last_invisible = oldlast;
+}
+
/* Redisplay the current line after a SIGWINCH is received. */
void
_rl_redisplay_after_sigwinch ()
{
- char *t, *oldp, *oldl, *oldlprefix;
+ char *t;
/* Clear the current line and put the cursor at column 0. Make sure
the right thing happens if we have wrapped to a new screen line. */
@@ -1542,7 +1621,7 @@ _rl_redisplay_after_sigwinch ()
putc ('\r', rl_outstream);
#else
tputs (term_cr, 1, _rl_output_character_function);
-#endif /* !__MSDOS__ */
+#endif
_rl_last_c_pos = 0;
#if defined (__MSDOS__)
space_to_eol (screenwidth);
@@ -1565,17 +1644,7 @@ _rl_redisplay_after_sigwinch ()
/* Redraw only the last line of a multi-line prompt. */
t = strrchr (rl_display_prompt, '\n');
if (t)
- {
- oldp = rl_display_prompt;
- oldl = local_prompt;
- oldlprefix = local_prompt_prefix;
- rl_display_prompt = ++t;
- local_prompt = local_prompt_prefix = (char *)NULL;
- rl_forced_update_display ();
- rl_display_prompt = oldp;
- local_prompt = oldl;
- local_prompt_prefix = oldlprefix;
- }
+ redraw_prompt (++t);
else
rl_forced_update_display ();
}
@@ -1600,3 +1669,25 @@ _rl_erase_entire_line ()
cr ();
fflush (rl_outstream);
}
+
+/* return the `current display line' of the cursor -- the number of lines to
+ move up to get to the first screen line of the current readline line. */
+int
+_rl_current_display_line ()
+{
+ int ret, nleft;
+
+ /* Find out whether or not there might be invisible characters in the
+ editing buffer. */
+ if (rl_display_prompt == rl_prompt)
+ nleft = _rl_last_c_pos - screenwidth - rl_visible_prompt_length;
+ else
+ nleft = _rl_last_c_pos - screenwidth;
+
+ if (nleft > 0)
+ ret = 1 + nleft / screenwidth;
+ else
+ ret = 0;
+
+ return ret;
+}
diff --git a/readline/doc/ChangeLog b/readline/doc/ChangeLog
index 3c26ae543f2..995c43a18ef 100644
--- a/readline/doc/ChangeLog
+++ b/readline/doc/ChangeLog
@@ -1,3 +1,12 @@
+2000-07-09 Elena Zannoni
+
+ * Import of readline 4.1.
+
+ Regenerated inc-hist.texinfo as copy of hsuser.texinfo, for
+ inclusion in the gdb manual.
+
+ New file: rluserman.texinfo
+
Tue Apr 18 15:43:52 2000 Andrew Cagney
* readline.0: Delete. Generated by Makefile, deleted by distclean
diff --git a/readline/doc/Makefile.in b/readline/doc/Makefile.in
index 103147292d9..4a38563e46e 100644
--- a/readline/doc/Makefile.in
+++ b/readline/doc/Makefile.in
@@ -1,6 +1,23 @@
# This makefile for Readline library documentation is in -*- text -*- mode.
# Emacs likes it that way.
-top_srcdir = @top_srcdir@
+
+# Copyright (C) 1996 Free Software Foundation, Inc.
+
+# 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 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
+
+topdir = @top_srcdir@
srcdir = @srcdir@
VPATH = .:@srcdir@
@@ -8,25 +25,33 @@ prefix = @prefix@
infodir = @infodir@
mandir = @mandir@
-man3dir = $(mandir)/man3
+manpfx = man
+
+man1ext = 1
+man1dir = $(mandir)/$(manpfx)$(man1ext)
+man3ext = 3
+man3dir = $(mandir)/$(manpfx)$(man3ext)
SHELL = @MAKE_SHELL@
RM = rm -f
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+BUILD_DIR = @BUILD_DIR@
TEXINPUTDIR = $(srcdir)
-MAKEINFO = makeinfo
+MAKEINFO = LANGUAGE= makeinfo
TEXI2DVI = $(srcdir)/texi2dvi
TEXI2HTML = $(srcdir)/texi2html
QUIETPS = #set this to -q to shut up dvips
-DVIPS = dvips -D 300 $(QUIETPS) -o $@ # tricky
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
+PAPERSIZE = letter
+PSDPI = 300 # I don't have any 600-dpi printers
+DVIPS = dvips -D ${PSDPI} $(QUIETPS) -t ${PAPERSIZE} -o $@ # tricky
RLSRC = $(srcdir)/rlman.texinfo $(srcdir)/rluser.texinfo \
- $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo
+ $(srcdir)/rltech.texinfo $(srcdir)/manvers.texinfo \
+ $(srcdir)/rluserman.texinfo
HISTSRC = $(srcdir)/hist.texinfo $(srcdir)/hsuser.texinfo \
$(srcdir)/hstech.texinfo $(srcdir)/manvers.texinfo
@@ -36,16 +61,15 @@ NROFF = groff -Tascii
# This should be a program that converts troff to postscript
GROFF = groff
-DVIOBJ = readline.dvi history.dvi
-INFOOBJ = readline.info history.info
-PSOBJ = readline.ps history.ps
-HTMLOBJ = readline.html history.html
-HTMLTOC = readline_toc.html history_toc.html
+DVIOBJ = readline.dvi history.dvi rluserman.dvi
+INFOOBJ = readline.info history.info rluserman.info
+PSOBJ = readline.ps history.ps rluserman.ps
+HTMLOBJ = readline.html history.html rluserman.html
TEXTOBJ = readline.0
-INTERMEDIATE_OBJ = rlman.dvi hist.dvi
+INTERMEDIATE_OBJ = rlman.dvi hist.dvi rluserman.dvi
-CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(HTMLTOC) $(TEXTOBJ)
+CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(TEXTOBJ)
.SUFFIXES: .0 .3 .ps .txt .dvi
@@ -63,6 +87,12 @@ readline.dvi: $(RLSRC)
readline.info: $(RLSRC)
$(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texinfo
+rluserman.dvi: $(RLSRC)
+ TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rluserman.texinfo
+
+rluserman.info: $(RLSRC)
+ $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rluserman.texinfo
+
history.dvi: ${HISTSRC}
TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/hist.texinfo
mv hist.dvi history.dvi
@@ -74,18 +104,25 @@ readline.ps: readline.dvi
$(RM) $@
$(DVIPS) readline.dvi
+rluserman.ps: rluserman.dvi
+ $(RM) $@
+ $(DVIPS) rluserman.dvi
+
history.ps: history.dvi
$(RM) $@
$(DVIPS) history.dvi
readline.html: ${RLSRC}
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rlman.texinfo
- sed -e 's:rlman.html:readline.html:' rlman.html > readline.html
+ sed -e 's:rlman.html:readline.html:g' rlman.html > readline.html
$(RM) rlman.html
+rluserman.html: ${RLSRC}
+ $(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/rluserman.texinfo
+
history.html: ${HISTSRC}
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/hist.texinfo
- sed -e 's:hist.html:history.html:' hist.html > history.html
+ sed -e 's:hist.html:history.html:g' hist.html > history.html
$(RM) hist.html
info: $(INFOOBJ)
@@ -98,7 +135,7 @@ readline.0: readline.3
clean:
$(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \
- *.fns *.kys *.tps *.vrs *.o core
+ *.fns *.kys *.tps *.vrs *.bt *.bts *.o core
distclean: clean
$(RM) $(CREATED_DOCS)
@@ -112,8 +149,8 @@ maintainer-clean: clean
$(RM) $(INTERMEDIATE_OBJ)
$(RM) Makefile
-installdirs: $(top_srcdir)/support/mkdirs
- -$(SHELL) $(top_srcdir)/support/mkdirs $(infodir) $(man3dir)
+installdirs: $(topdir)/support/mkdirs
+ -$(SHELL) $(topdir)/support/mkdirs $(infodir) $(man3dir)
install: installdirs
if test -f readline.info; then \
@@ -121,12 +158,17 @@ install: installdirs
else \
${INSTALL_DATA} $(srcdir)/readline.info $(infodir)/readline.info; \
fi
+ if test -f rluserman.info; then \
+ ${INSTALL_DATA} rluserman.info $(infodir)/rluserman.info; \
+ else \
+ ${INSTALL_DATA} $(srcdir)/rluserman.info $(infodir)/rluserman.info; \
+ fi
if test -f history.info; then \
${INSTALL_DATA} history.info $(infodir)/history.info; \
else \
${INSTALL_DATA} $(srcdir)/history.info $(infodir)/history.info; \
fi
- if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
install-info --dir-file=$(infodir)/dir $(infodir)/readline.info ; \
install-info --dir-file=$(infodir)/dir $(infodir)/history.info ; \
else true; fi
@@ -134,5 +176,6 @@ install: installdirs
uninstall:
$(RM) $(infodir)/readline.info
+ $(RM) $(infodir)/rluserman.info
$(RM) $(infodir)/history.info
$(RM) $(man3dir)/readline.3
diff --git a/readline/doc/hist.texinfo b/readline/doc/hist.texinfo
index 31a0ba0ae72..8a9c9413bc9 100644
--- a/readline/doc/hist.texinfo
+++ b/readline/doc/hist.texinfo
@@ -55,8 +55,8 @@ provides a consistent user interface for recalling lines of previously
typed input.
Published by the Free Software Foundation @*
-675 Massachusetts Avenue, @*
-Cambridge, MA 02139 USA
+59 Temple Place, Suite 330, @*
+Boston, MA 02111 USA
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
diff --git a/readline/doc/history.dvi b/readline/doc/history.dvi
deleted file mode 100644
index a8b30bf92be890744a7d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SYO@%!*x~(r3!jw~mK#3ll>;eNGWM*Ce6HKozO-)}2OV#!J5q}Cpf_5LH_D-Up@gc^)Op0b
z=YcE!6_72HAmjbr4ie(qCB!+Z{ZRp$qhya+x4Z+){S$z~g71S>GSvh;W+_k;UyxO8
zeFE02zYC3$SplPDxs+xsD{zpk_KB=^wXc)_q;IX-3kVNf4LYlDi!bZNH-R23Q``44
zHA#7wNXipmhjb8}`wGt4DpiUmtp~xluV9=Ls5d{nx?=E+69V<-v#PE)-vd9@EwNoR
z{@hga*cVn5jf#ciE8N}MIam*l1>$A`Z*t}Ld)>x7@VT|EAy+i21rxdfl3q=HZUThc3v64of7c>Cia*9%RReHtp&F5*qu-_tQ%R
z%Kwpn-9uj+fJ60dKm58qz3wbTLSxh&KRmPDZ}%koxAsrJ1u*_{VR+`>LsMGSZ)nC7
z{TdEb*Z2&*!D!>)zkC1J9k=JnVw87vy6lK^urDVeV3BByh$vX7-aC6mqp=4TyxsBN
z+Em1AKLSY22qbEWZCddX81
h|A#@4MR`6PB;j>e<08wTdDxPr3C0|
ze_2q1&pv+;^!owo9pj6$xQ4)%{ajcWj-jQDtLfW5d;=UWOfJXL2#>zsMtu2!TYKXT
z`+);@!s!j?Nevo3IunRpQSEm{05Wrqm;;DUED
z$sKanM+1kRMc5NxQ&nkqUHCa%YwR0?YoI%c
zHK%glvn&a#%@l#vJ$v@-t}^PmQ4Opb#-^Hu6J}NsSbZ}T`sTWt>o-02!8V*G{8H^e
z%kwo)+`lI@CUn&BWsg6*^p4O`k6uNc&&FUZGuk|S5j{Qhq+bM{ju7`8Zl|~Lx%&2*
z^z?{x?h8CU{e@TNb<-0OXLMkOc^`OV^2O>?c(-Y|ZPMiW&1y{2?t!PX(UM+
zPiJNCYdSaZGzCv9Mm2|9Xb
-
-
-
-GNU History Library
-
-
-GNU History Library
-Edition 4.1, for History Library Version 4.1.
-January 2000
-Brian Fox, Free Software Foundation
-Chet Ramey, Case Western Reserve University
-
-
-
Table of Contents
-
-
-
-
-This document describes the GNU History library, a programming tool that
-provides a consistent user interface for recalling lines of previously
-typed input.
-
-
-
-Published by the Free Software Foundation
-59 Temple Place, Suite 330,
-Boston, MA 02111 USA
-
-
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-
-
-
-Copyright (C) 1988-1999 Free Software Foundation, Inc.
-
-
-
-
-
-
-
-
-This chapter describes how to use the GNU History Library interactively,
-from a user's standpoint. It should be considered a user's guide. For
-information on using the GNU History Library in your own programs,
-see section Programming with GNU History.
-
-
-
-
-
-
-
-
-
-
-
-
-
-The History library provides a history expansion feature that is similar
-to the history expansion provided by csh. This section
-describes the syntax used to manipulate the history information.
-
-
-
-History expansions introduce words from the history list into
-the input stream, making it easy to repeat commands, insert the
-arguments to a previous command into the current input line, or
-fix errors in previous commands quickly.
-
-
-
-History expansion takes place in two parts. The first is to determine
-which line from the history list should be used during substitution.
-The second is to select portions of that line for inclusion into the
-current one. The line selected from the history is called the
-event, and the portions of that line that are acted upon are
-called words. Various modifiers are available to manipulate
-the selected words. The line is broken into words in the same fashion
-that Bash does, so that several words
-surrounded by quotes are considered one word.
-History expansions are introduced by the appearance of the
-history expansion character, which is `!' by default.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-An event designator is a reference to a command line entry in the
-history list.
-
-
-
-
-
-!
--
-Start a history substitution, except when followed by a space, tab,
-the end of the line, `=' or `('.
-
-
!n
--
-Refer to command line n.
-
-
!-n
--
-Refer to the command n lines back.
-
-
!!
--
-Refer to the previous command. This is a synonym for `!-1'.
-
-
!string
--
-Refer to the most recent command starting with string.
-
-
!?string[?]
--
-Refer to the most recent command containing string. The trailing
-`?' may be omitted if the string is followed immediately by
-a newline.
-
-
^string1^string2^
--
-Quick Substitution. Repeat the last command, replacing string1
-with string2. Equivalent to
-
!!:s/string1/string2/.
-
- !#
--
-The entire command line typed so far.
-
-
-
-
-
-
-
-
-Word designators are used to select desired words from the event.
-A `:' separates the event specification from the word designator. It
-may be omitted if the word designator begins with a `^', `$',
-`*', `-', or `%'. Words are numbered from the beginning
-of the line, with the first word being denoted by 0 (zero). Words are
-inserted into the current line separated by single spaces.
-
-
-
-For example,
-
-
-
-
-!!
--
-designates the preceding command. When you type this, the preceding
-command is repeated in toto.
-
-
!!:$
--
-designates the last argument of the preceding command. This may be
-shortened to
!$.
-
- !fi:2
--
-designates the second argument of the most recent command starting with
-the letters
fi.
-
-
-
-Here are the word designators:
-
-
-
-0 (zero)
--
-The
0th word. For many applications, this is the command word.
-
- n
--
-The nth word.
-
-
^
--
-The first argument; that is, word 1.
-
-
$
--
-The last argument.
-
-
%
--
-The word matched by the most recent `?string?' search.
-
-
x-y
--
-A range of words; `-y' abbreviates `0-y'.
-
-
*
--
-All of the words, except the
0th. This is a synonym for `1-$'.
-It is not an error to use `*' if there is just one word in the event;
-the empty string is returned in that case.
-
- x*
--
-Abbreviates `x-$'
-
-
x-
--
-Abbreviates `x-$' like `x*', but omits the last word.
-
-
-
-
-If a word designator is supplied without an event specification, the
-previous command is used as the event.
-
-
-
-
-
-
-
-After the optional word designator, you can add a sequence of one or more
-of the following modifiers, each preceded by a `:'.
-
-
-
-
-h
--
-Remove a trailing pathname component, leaving only the head.
-
-
t
--
-Remove all leading pathname components, leaving the tail.
-
-
r
--
-Remove a trailing suffix of the form `.suffix', leaving
-the basename.
-
-
e
--
-Remove all but the trailing suffix.
-
-
p
--
-Print the new command but do not execute it.
-
-
s/old/new/
--
-Substitute new for the first occurrence of old in the
-event line. Any delimiter may be used in place of `/'.
-The delimiter may be quoted in old and new
-with a single backslash. If `&' appears in new,
-it is replaced by old. A single backslash will quote
-the `&'. The final delimiter is optional if it is the last
-character on the input line.
-
-
&
--
-Repeat the previous substitution.
-
-
g
--
-Cause changes to be applied over the entire event line. Used in
-conjunction with `s', as in
gs/old/new/,
-or with `&'.
-
-
-
-
-
-
-
-
-This chapter describes how to interface programs that you write
-with the GNU History Library.
-It should be considered a technical guide.
-For information on the interactive use of GNU History, see section Using History Interactively.
-
-
-
-
-
-
-
-
-
-
-Many programs read input from the user a line at a time. The GNU History
-library is able to keep track of those lines, associate arbitrary data with
-each line, and utilize information from previous lines in composing new
-ones.
-
-
-
-The programmer using the History library has available functions
-for remembering lines on a history list, associating arbitrary data
-with a line, removing lines from the list, searching through the list
-for a line containing an arbitrary text string, and referencing any line
-in the list directly. In addition, a history expansion function
-is available which provides for a consistent user interface across
-different programs.
-
-
-
-The user using programs written with the History library has the
-benefit of a consistent user interface with a set of well-known
-commands for manipulating the text of previous lines and using that text
-in new commands. The basic history manipulation commands are similar to
-the history substitution provided by csh.
-
-
-
-If the programmer desires, he can use the Readline library, which
-includes some history manipulation by default, and has the added
-advantage of command line editing.
-
-
-
-Before declaring any functions using any functionality the History
-library provides in other code, an application writer should include
-the file <readline/history.h> in any file that uses the
-History library's features. It supplies extern declarations for all
-of the library's public functions and variables, and declares all of
-the public data structures.
-
-
-
-
-
-
-
-The history list is an array of history entries. A history entry is
-declared as follows:
-
-
-
-
-typedef struct _hist_entry {
- char *line;
- char *data;
-} HIST_ENTRY;
-
-
-
-The history list itself might therefore be declared as
-
-
-
-
-HIST_ENTRY **the_history_list;
-
-
-
-The state of the History library is encapsulated into a single structure:
-
-
-
-
-/* A structure used to pass the current state of the history stuff around. */
-typedef struct _hist_state {
- HIST_ENTRY **entries; /* Pointer to the entries themselves. */
- int offset; /* The location pointer within this array. */
- int length; /* Number of elements within this array. */
- int size; /* Number of slots allocated to this array. */
- int flags;
-} HISTORY_STATE;
-
-
-
-If the flags member includes HS_STIFLED, the history has been
-stifled.
-
-
-
-
-
-
-
-This section describes the calling sequence for the various functions
-present in GNU History.
-
-
-
-
-
-
-
-
-
-
-This section describes functions used to initialize and manage
-the state of the History library when you want to use the history
-functions in your program.
-
-
-
-
-- Function: void using_history ()
-
-
-Begin a session in which the history functions might be used. This
-initializes the interactive variables.
-
-
-
-
-
-- Function: HISTORY_STATE * history_get_history_state ()
-
-
-Return a structure describing the current state of the input history.
-
-
-
-
-
-- Function: void history_set_history_state (HISTORY_STATE *state)
-
-
-Set the state of the history list according to state.
-
-
-
-
-
-
-
-
-These functions manage individual entries on the history list, or set
-parameters managing the list itself.
-
-
-
-
-- Function: void add_history (char *string)
-
-
-Place string at the end of the history list. The associated data
-field (if any) is set to
NULL.
-
-
-
-
-
-- Function: HIST_ENTRY * remove_history (int which)
-
-
-Remove history entry at offset which from the history. The
-removed element is returned so you can free the line, data,
-and containing structure.
-
-
-
-
-
-- Function: HIST_ENTRY * replace_history_entry (int which, char *line, char *data)
-
-
-Make the history entry at offset which have line and data.
-This returns the old entry so you can dispose of the data. In the case
-of an invalid which, a
NULL pointer is returned.
-
-
-
-
-
-- Function: void clear_history ()
-
-
-Clear the history list by deleting all the entries.
-
-
-
-
-
-- Function: void stifle_history (int max)
-
-
-Stifle the history list, remembering only the last max entries.
-
-
-
-
-
-- Function: int unstifle_history ()
-
-
-Stop stifling the history. This returns the previous amount the
-history was stifled. The value is positive if the history was
-stifled, negative if it wasn't.
-
-
-
-
-
-- Function: int history_is_stifled ()
-
-
-Returns non-zero if the history is stifled, zero if it is not.
-
-
-
-
-
-
-
-
-These functions return information about the entire history list or
-individual list entries.
-
-
-
-
-- Function: HIST_ENTRY ** history_list ()
-
-
-Return a
NULL terminated array of HIST_ENTRY which is the
-current input history. Element 0 of this list is the beginning of time.
-If there is no history, return NULL.
-
-
-
-
-
-- Function: int where_history ()
-
-
-Returns the offset of the current history element.
-
-
-
-
-
-- Function: HIST_ENTRY * current_history ()
-
-
-Return the history entry at the current position, as determined by
-
where_history (). If there is no entry there, return a NULL
-pointer.
-
-
-
-
-
-- Function: HIST_ENTRY * history_get (int offset)
-
-
-Return the history entry at position offset, starting from
-
history_base. If there is no entry there, or if offset
-is greater than the history length, return a NULL pointer.
-
-
-
-
-
-- Function: int history_total_bytes ()
-
-
-Return the number of bytes that the primary history entries are using.
-This function returns the sum of the lengths of all the lines in the
-history.
-
-
-
-
-
-
-
-
-These functions allow the current index into the history list to be
-set or changed.
-
-
-
-
-- Function: int history_set_pos (int pos)
-
-
-Set the position in the history list to pos, an absolute index
-into the list.
-
-
-
-
-
-- Function: HIST_ENTRY * previous_history ()
-
-
-Back up the current history offset to the previous history entry, and
-return a pointer to that entry. If there is no previous entry, return
-a
NULL pointer.
-
-
-
-
-
-- Function: HIST_ENTRY * next_history ()
-
-
-Move the current history offset forward to the next history entry, and
-return the a pointer to that entry. If there is no next entry, return
-a
NULL pointer.
-
-
-
-
-
-
-
-
-
-
-
-These functions allow searching of the history list for entries containing
-a specific string. Searching may be performed both forward and backward
-from the current history position. The search may be anchored,
-meaning that the string must match at the beginning of the history entry.
-
-
-
-
-
-- Function: int history_search (char *string, int direction)
-
-
-Search the history for string, starting at the current history
-offset. If direction < 0, then the search is through previous entries,
-else through subsequent. If string is found, then
-the current history index is set to that history entry, and the value
-returned is the offset in the line of the entry where
-string was found. Otherwise, nothing is changed, and a -1 is
-returned.
-
-
-
-
-
-- Function: int history_search_prefix (char *string, int direction)
-
-
-Search the history for string, starting at the current history
-offset. The search is anchored: matching lines must begin with
-string. If direction < 0, then the search is through previous
-entries, else through subsequent. If string is found, then the
-current history index is set to that entry, and the return value is 0.
-Otherwise, nothing is changed, and a -1 is returned.
-
-
-
-
-
-- Function: int history_search_pos (char *string, int direction, int pos)
-
-
-Search for string in the history list, starting at pos, an
-absolute index into the list. If direction is negative, the search
-proceeds backward from pos, otherwise forward. Returns the absolute
-index of the history element where string was found, or -1 otherwise.
-
-
-
-
-
-
-
-
-The History library can read the history from and write it to a file.
-This section documents the functions for managing a history file.
-
-
-
-
-- Function: int read_history (char *filename)
-
-
-Add the contents of filename to the history list, a line at a
-time. If filename is
NULL, then read from
-`~/.history'. Returns 0 if successful, or errno if not.
-
-
-
-
-
-- Function: int read_history_range (char *filename, int from, int to)
-
-
-Read a range of lines from filename, adding them to the history list.
-Start reading at line from and end at to. If
-from is zero, start at the beginning. If to is less than
-from, then read until the end of the file. If filename is
-
NULL, then read from `~/.history'. Returns 0 if successful,
-or errno if not.
-
-
-
-
-
-- Function: int write_history (char *filename)
-
-
-Write the current history to filename, overwriting filename
-if necessary. If filename is
-
NULL, then write the history list to `~/.history'. Values
-returned are as in read_history ().
-
-
-
-
-
-- Function: int append_history (int nelements, char *filename)
-
-
-Append the last nelements of the history list to filename.
-
-
-
-
-
-- Function: int history_truncate_file (char *filename, int nlines)
-
-
-Truncate the history file filename, leaving only the last
-nlines lines.
-
-
-
-
-
-
-
-
-These functions implement csh-like history expansion.
-
-
-
-
-- Function: int history_expand (char *string, char **output)
-
-
-Expand string, placing the result into output, a pointer
-to a string (see section History Expansion). Returns:
-
-
-0
--
-If no expansions took place (or, if the only change in
-the text was the de-slashifying of the history expansion
-character);
-
1
--
-if expansions did take place;
-
-1
--
-if there was an error in expansion;
-
2
--
-if the returned line should be displayed, but not executed,
-as with the
:p modifier (see section Modifiers).
-
-
-
-If an error ocurred in expansion, then output contains a descriptive
-error message.
-
-
-
-
-
-- Function: char * history_arg_extract (int first, int last, char *string)
-
-
-Extract a string segment consisting of the first through last
-arguments present in string. Arguments are broken up as in Bash.
-
-
-
-
-
-- Function: char * get_history_event (char *string, int *cindex, int qchar)
-
-
-Returns the text of the history event beginning at string +
-*cindex. *cindex is modified to point to after the event
-specifier. At function entry, cindex points to the index into
-string where the history event specification begins. qchar
-is a character that is allowed to end the event specification in addition
-to the "normal" terminating characters.
-
-
-
-
-
-- Function: char ** history_tokenize (char *string)
-
-
-Return an array of tokens parsed out of string, much as the
-shell might. The tokens are split on white space and on the
-characters
()<>;&|$, and shell quoting conventions are
-obeyed.
-
-
-
-
-
-
-
-
-This section describes the externally visible variables exported by
-the GNU History Library.
-
-
-
-
-- Variable: int history_base
-
-
-The logical offset of the first entry in the history list.
-
-
-
-
-
-- Variable: int history_length
-
-
-The number of entries currently stored in the history list.
-
-
-
-
-
-- Variable: int max_input_history
-
-
-The maximum number of history entries. This must be changed using
-
stifle_history ().
-
-
-
-
-
-- Variable: char history_expansion_char
-
-
-The character that starts a history event. The default is `!'.
-
-
-
-
-
-- Variable: char history_subst_char
-
-
-The character that invokes word substitution if found at the start of
-a line. The default is `^'.
-
-
-
-
-
-- Variable: char history_comment_char
-
-
-During tokenization, if this character is seen as the first character
-of a word, then it and all subsequent characters up to a newline are
-ignored, suppressing history expansion for the remainder of the line.
-This is disabled by default.
-
-
-
-
-
-- Variable: char * history_no_expand_chars
-
-
-The list of characters which inhibit history expansion if found immediately
-following history_expansion_char. The default is whitespace and
-`='.
-
-
-
-
-
-- Variable: char * history_search_delimiter_chars
-
-
-The list of additional characters which can delimit a history search
-string, in addition to whitespace, `:' and `?' in the case of
-a substring search. The default is empty.
-
-
-
-
-
-- Variable: int history_quotes_inhibit_expansion
-
-
-If non-zero, single-quoted words are not scanned for the history expansion
-character. The default value is 0.
-
-
-
-
-
-- Variable: Function * history_inhibit_expansion_function
-
-
-This should be set to the address of a function that takes two arguments:
-a
char * (string) and an integer index into that string (i).
-It should return a non-zero value if the history expansion starting at
-string[i] should not be performed; zero if the expansion should
-be done.
-It is intended for use by applications like Bash that use the history
-expansion character for additional purposes.
-By default, this variable is set to NULL.
-
-
-
-
-
-
-
-
-The following program demonstrates simple use of the GNU History Library.
-
-
-
-
-main ()
-{
- char line[1024], *t;
- int len, done = 0;
-
- line[0] = 0;
-
- using_history ();
- while (!done)
- {
- printf ("history$ ");
- fflush (stdout);
- t = fgets (line, sizeof (line) - 1, stdin);
- if (t && *t)
- {
- len = strlen (t);
- if (t[len - 1] == '\n')
- t[len - 1] = '\0';
- }
-
- if (!t)
- strcpy (line, "quit");
-
- if (line[0])
- {
- char *expansion;
- int result;
-
- result = history_expand (line, &expansion);
- if (result)
- fprintf (stderr, "%s\n", expansion);
-
- if (result < 0 || result == 2)
- {
- free (expansion);
- continue;
- }
-
- add_history (expansion);
- strncpy (line, expansion, sizeof (line) - 1);
- free (expansion);
- }
-
- if (strcmp (line, "quit") == 0)
- done = 1;
- else if (strcmp (line, "save") == 0)
- write_history ("history_file");
- else if (strcmp (line, "read") == 0)
- read_history ("history_file");
- else if (strcmp (line, "list") == 0)
- {
- register HIST_ENTRY **the_list;
- register int i;
-
- the_list = history_list ();
- if (the_list)
- for (i = 0; the_list[i]; i++)
- printf ("%d: %s\n", i + history_base, the_list[i]->line);
- }
- else if (strncmp (line, "delete", 6) == 0)
- {
- int which;
- if ((sscanf (line + 6, "%d", &which)) == 1)
- {
- HIST_ENTRY *entry = remove_history (which);
- if (!entry)
- fprintf (stderr, "No such entry %d\n", which);
- else
- {
- free (entry->line);
- free (entry);
- }
- }
- else
- {
- fprintf (stderr, "non-numeric arg given to `delete'\n");
- }
- }
- }
-}
-
-
-
-
-
-
-Jump to:
-a
--
-e
--
-h
-
-
-
-anchored search
-
-
-
-event designators
-
-
-
-history events
-history expansion
-History Searching
-
-
-
-
-
-
-
-Jump to:
-a
--
-c
--
-g
--
-h
--
-m
--
-n
--
-p
--
-r
--
-s
--
-u
--
-w
-
-
-
-add_history
-append_history
-
-
-
-clear_history
-current_history
-
-
-
-get_history_event
-
-
-
-history_arg_extract
-history_base
-history_comment_char
-history_expand
-history_expansion_char
-history_get
-history_get_history_state
-history_inhibit_expansion_function
-history_is_stifled
-history_length
-history_list
-history_no_expand_chars
-history_quotes_inhibit_expansion
-history_search
-history_search_delimiter_chars
-history_search_pos
-history_search_prefix
-history_set_history_state
-history_set_pos
-history_subst_char
-history_tokenize
-history_total_bytes
-history_truncate_file
-
-
-
-max_input_history
-
-
-
-next_history
-
-
-
-previous_history
-
-
-
-read_history
-read_history_range
-remove_history
-replace_history_entry
-
-
-
-stifle_history
-
-
-
-unstifle_history
-using_history
-
-
-
-where_history
-write_history
-
-
-
-
-This document was generated on 19 January 2000 using the
-texi2html
-translator version 1.52.
-
-