File readline-4.3.dif of Package compat-readline4

Index: .pkgextract
===================================================================
--- /dev/null
+++ .pkgextract
@@ -0,0 +1,10 @@
+patch -p2 -s --suffix=".display"    < ../bash-2.05b-display.patch
+patch -p2 -s --suffix=".dispmbs"    < ../bash-2.05b-display-mbspeed.patch
+patch -p3 -s --suffix=".complete"   < ../bash-2.05b-complete.patch
+patch -p2 -s --suffix=".infinite"   < ../bash-2.05b-infinite.patch
+patch -p2 -s --suffix=".mbutil"     < ../bash-2.05b-mbutil.patch
+patch -p3 -s --suffix=".rlinit"     < ../bash-2.05b-readline-init.patch
+patch -p2 -s --suffix=".vimode"     < ../bash-2.05b-vimode.patch
+patch -p2 -s --suffix=".utf8"       < ../bash-2.05b-utf8.patch
+#patch -p0 -s --suffix=".destdir"    < ../readline-4.3-destdir.patch
+#patch -p0 -s --suffix=".zerotty"    < ../readline-4.3-input.dif
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -208,15 +208,13 @@ maybe-uninstall-headers: uninstall-heade
 install:	$(INSTALL_TARGETS)
 
 install-static: installdirs $(STATIC_LIBS) install-headers
-	-$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old
 	$(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a
 	-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a
-	-$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old
 	$(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a
 	-test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a
 	-( if test -d doc ; then \
 		cd doc && \
-		${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
+		${MAKE} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
 	  fi )
 
 installdirs: $(srcdir)/support/mkdirs
Index: bind.c
===================================================================
--- bind.c.orig
+++ bind.c
@@ -279,7 +279,10 @@ rl_generic_bind (type, keyseq, data, map
 
       ic = uc;
       if (ic < 0 || ic >= KEYMAP_SIZE)
-	return -1;
+	{
+	  free (keys);
+	  return -1;
+	}
 
       if (_rl_convert_meta_chars_to_ascii && META_CHAR (ic))
 	{
@@ -625,6 +628,9 @@ rl_function_of_keyseq (keyseq, map, type
 /* The last key bindings file read. */
 static char *last_readline_init_file = (char *)NULL;
 
+/* Flag to read system init file */
+static int read_system_init_file = 0;
+
 /* The file we're currently reading key bindings from. */
 static const char *current_readline_init_file;
 static int current_readline_init_include_level;
@@ -692,7 +698,7 @@ rl_re_read_init_file (count, ignore)
    to the first non-null filename from this list:
      1. the filename used for the previous call
      2. the value of the shell variable `INPUTRC'
-     3. ~/.inputrc
+     3. /etc/inputrc and ~/.inputrc
    If the file existed and could be opened and read, 0 is returned,
    otherwise errno is returned. */
 int
@@ -704,13 +710,27 @@ rl_read_init_file (filename)
     {
       filename = last_readline_init_file;
       if (filename == 0)
+      {
         filename = sh_get_env_value ("INPUTRC");
+	if (filename && !strncmp(SYSTEM_INPUTRC, filename, strlen(SYSTEM_INPUTRC)))
+	  read_system_init_file = 0;
+	else
+	  read_system_init_file = 1;
+      }
       if (filename == 0)
+      {
 	filename = DEFAULT_INPUTRC;
+        read_system_init_file = 1;
+      }
     }
 
   if (*filename == 0)
+  {
     filename = DEFAULT_INPUTRC;
+    read_system_init_file = 1;
+  }
+  if (read_system_init_file)
+    _rl_read_init_file (SYSTEM_INPUTRC, 1);
 
 #if defined (__MSDOS__)
   if (_rl_read_init_file (filename, 0) == 0)
@@ -1199,6 +1219,13 @@ rl_parse_and_bind (string)
 
 	  rl_macro_bind (seq, &funname[1], _rl_keymap);
 	}
+#if 0 /* defined (PREFIX_META_HACK) */
+      /* Ugly, but working hack to keep prefix-meta around. */
+      else if (_rl_stricmp (funname, "prefix-meta") == 0)
+	{
+	  rl_generic_bind (ISKMAP, seq, (char *)emacs_meta_keymap, _rl_keymap);
+	}
+#endif /* PREFIX_META_HACK */
       else
 	rl_set_key (seq, rl_named_function (funname), _rl_keymap);
 
Index: complete.c
===================================================================
--- complete.c.orig
+++ complete.c
@@ -396,7 +396,7 @@ get_y_or_n (for_pager)
 	return (1);
       if (c == 'n' || c == 'N' || c == RUBOUT)
 	return (0);
-      if (c == ABORT_CHAR)
+      if (c == ABORT_CHAR || c == EOF)
 	_rl_abort_internal ();
       if (for_pager && (c == NEWLINE || c == RETURN))
 	return (2);
@@ -794,7 +794,7 @@ _rl_find_completion_word (fp, dp)
          completion, so use the word break characters to find the
          substring on which to complete. */
 #if defined (HANDLE_MULTIBYTE)
-      while (rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY))
+      while ((rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY)))
 #else
       while (--rl_point)
 #endif
@@ -1692,7 +1692,7 @@ rl_completion_matches (text, entry_funct
   match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
   match_list[1] = (char *)NULL;
 
-  while (string = (*entry_function) (text, matches))
+  while ((string = (*entry_function) (text, matches)))
     {
       if (matches + 1 == match_list_size)
 	match_list = (char **)xrealloc
@@ -1742,7 +1742,7 @@ rl_username_completion_function (text, s
       setpwent ();
     }
 
-  while (entry = getpwent ())
+  while ((entry = getpwent ()))
     {
       /* Null usernames should result in all users as possible completions. */
       if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
Index: doc/Makefile.in
===================================================================
--- doc/Makefile.in.orig
+++ doc/Makefile.in
@@ -83,7 +83,7 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ
 	$(RM) $@
 	-${NROFF} -man $< > $@
 
-all: info dvi html ps text
+all: info html
 nodvi: info html text
 
 readline.dvi: $(RLSRC)
Index: doc/readline.3
===================================================================
--- doc/readline.3.orig
+++ doc/readline.3
@@ -114,8 +114,8 @@ Readline is customized by putting comman
 file (the \fIinputrc\fP file).
 The name of this file is taken from the value of the
 .B INPUTRC
-environment variable.  If that variable is unset, the default is
-.IR ~/.inputrc .
+environment variable.  If that variable is unset, readline will read both
+.IR /etc/inputrc " and " ~/.inputrc .
 When a program which uses the readline library starts up, the
 init file is read, and the key bindings and variables are set.
 There are only a few basic constructs allowed in the
@@ -1238,6 +1238,9 @@ VI Command Mode functions
 .TP
 .FN ~/.inputrc
 Individual \fBreadline\fP initialization file
+.TP
+.FN /etc/inputrc
+System \fBreadline\fP initialization file
 .PD
 .SH AUTHORS
 Brian Fox, Free Software Foundation
Index: doc/rluser.texinfo
===================================================================
--- doc/rluser.texinfo.orig
+++ doc/rluser.texinfo
@@ -336,7 +336,8 @@ file is taken from the value of the shel
 @ifclear BashFeatures
 file is taken from the value of the environment variable @env{INPUTRC}.  If
 @end ifclear
-that variable is unset, the default is @file{~/.inputrc}.
+that variable is unset, Readline will read both @file{/etc/inputrc} and 
+@file{~/.inputrc}.
 
 When a program which uses the Readline library starts up, the
 init file is read, and the key bindings are set.
Index: readline.c
===================================================================
--- readline.c.orig
+++ readline.c
@@ -567,7 +567,11 @@ _rl_dispatch_subseq (key, map, got_subse
 	{
 	  /* Special case rl_do_lowercase_version (). */
 	  if (func == rl_do_lowercase_version)
-	    return (_rl_dispatch (_rl_to_lower (key), map));
+	    {
+	      if (key == ANYOTHERKEY)
+		return -1;
+	      return (_rl_dispatch (_rl_to_lower (key), map));
+	    }
 
 	  rl_executing_keymap = map;
 
Index: readline.h
===================================================================
--- readline.h.orig
+++ readline.h
@@ -429,7 +429,7 @@ extern char *rl_filename_completion_func
 
 extern int rl_completion_mode PARAMS((rl_command_func_t *));
 
-#if 0
+#ifdef OLD_READLINE
 /* Backwards compatibility (compat.c).  These will go away sometime. */
 extern void free_undo_list PARAMS((void));
 extern int maybe_save_line PARAMS((void));
Index: rlconf.h
===================================================================
--- rlconf.h.orig
+++ rlconf.h
@@ -39,6 +39,7 @@
 
 /* The final, last-ditch effort file name for an init file. */
 #define DEFAULT_INPUTRC "~/.inputrc"
+#define SYSTEM_INPUTRC "/etc/inputrc"
 
 /* If defined, expand tabs to spaces. */
 #define DISPLAY_TABS
Index: shlib/Makefile.in
===================================================================
--- shlib/Makefile.in.orig
+++ shlib/Makefile.in
@@ -46,6 +46,7 @@ prefix = @prefix@
 exec_prefix = @exec_prefix@
 includedir = @includedir@
 libdir = @libdir@
+linkagedir = $(libdir)
 
 # Support an alternate destination root directory for package building
 DESTDIR =
@@ -55,7 +56,7 @@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRA
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@ @LOCAL_LDFLAGS@ @CFLAGS@
 
-DEFS = @DEFS@
+DEFS = @DEFS@ -D_REENTRANT
 LOCAL_DEFS = @LOCAL_DEFS@
 
 #
@@ -164,8 +165,8 @@ installdirs: $(topdir)/support/mkdirs
 	-$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir)
 
 install: installdirs $(SHLIB_STATUS)
-	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
-	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
+	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -l $(linkagedir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
+	$(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -l $(linkagedir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
 	@echo install: you may need to run ldconfig
 
 uninstall:
Index: support/shlib-install
===================================================================
--- support/shlib-install.orig
+++ support/shlib-install
@@ -3,7 +3,7 @@
 # shlib-install - install a shared library and do any necessary host-specific
 #		  post-installation configuration (like ldconfig)
 #
-# usage: shlib-install [-D] -O host_os -d installation-dir -i install-prog [-U] library
+# usage: shlib-install [-D] -O host_os -d installation-dir -l linkage-dir -i install-prog [-U] library
 #
 # Chet Ramey
 # chet@po.cwru.edu
@@ -24,12 +24,14 @@ while [ $# -gt 0 ]; do
 	-O)	shift; host_os="$1"; shift ;;
 	-d)	shift; INSTALLDIR="$1"; shift ;;
 	-i)	shift; INSTALLPROG="$1" ; shift ;;
+	-l)	shift; LINKAGEDIR="$1" ; shift ;;
 	-D)	echo=echo ; shift ;;
 	-U)	uninstall=true ; shift ;;
 	-*)	echo "$USAGE" >&2 ; exit 2;;
 	*)	break ;;
 	esac
 done
+[ -z "$LINKAGEDIR" ] && LINKAGEDIR=$INSTALLDIR
 
 # set install target name
 LIBNAME="$1"
@@ -103,9 +105,9 @@ case "$host_os" in
 	fi
 
 	# libname.so -> libname.so.M.N
-	${echo} ${RM} ${INSTALLDIR}/$LINK1
+	${echo} ${RM} ${LINKAGEDIR}/$LINK1
 	if [ -z "$uninstall" ]; then
-		${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
+		${echo} ln -s ${INSTALLDIR}/$LIBNAME ${LINKAGEDIR}/$LINK1
 	fi
 	;;
 
Index: support/shobj-conf
===================================================================
--- support/shobj-conf.orig
+++ support/shobj-conf
@@ -100,10 +100,11 @@ sunos5*|solaris2*)
 linux*|gnu*)
 	SHOBJ_CFLAGS=-fPIC
 	SHOBJ_LD='${CC}'
-	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+	SHOBJ_LDFLAGS='-shared -Wl,-soname,$(basename $@)'
 
 	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
 	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+	SHLIB_LIBS=-lncurses
 	;;
 
 freebsd2* | netbsd*)
Index: terminal.c
===================================================================
--- terminal.c.orig
+++ terminal.c
@@ -145,6 +145,9 @@ static char *_rl_term_kh;
 static char *_rl_term_kH;
 static char *_rl_term_at7;	/* @7 */
 
+/* The key sequence sent by the Delete key, if any. */
+static char *_rl_term_kD;
+
 /* Insert key */
 static char *_rl_term_kI;
 
@@ -303,7 +306,7 @@ struct _tc_string {
    search algorithm to something smarter. */
 static struct _tc_string tc_strings[] =
 {
-  { "@7", &_rl_term_at7 },
+  { "@7", &_rl_term_at7 },	/* end */
   { "DC", &_rl_term_DC },
   { "IC", &_rl_term_IC },
   { "ce", &_rl_term_clreol },
@@ -313,6 +316,7 @@ static struct _tc_string tc_strings[] =
   { "ei", &_rl_term_ei },
   { "ic", &_rl_term_ic },
   { "im", &_rl_term_im },
+  { "kD", &_rl_term_kD },	/* delete */
   { "kH", &_rl_term_kH },	/* home down ?? */
   { "kI", &_rl_term_kI },	/* insert */
   { "kd", &_rl_term_kd },
@@ -496,6 +500,7 @@ bind_termcap_arrow_keys (map)
 
   _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line);	/* Home */
   _rl_bind_if_unbound (_rl_term_at7, rl_end_of_line);	/* End */
+  _rl_bind_if_unbound (_rl_term_kD, rl_delete);		/* Delete */
 
   _rl_keymap = xkeymap;
 }
Index: text.c
===================================================================
--- text.c.orig
+++ text.c
@@ -1106,6 +1106,9 @@ rl_delete_horizontal_space (count, ignor
       rl_delete_text (start, rl_point);
       rl_point = start;
     }
+  /* check for arithmetic overflow */
+  if (rl_point < 0)
+    rl_point = 0;
   return 0;
 }
 
openSUSE Build Service is sponsored by