summaryrefslogtreecommitdiffstats
path: root/SOURCES
diff options
context:
space:
mode:
Diffstat (limited to 'SOURCES')
-rw-r--r--SOURCES/bash-2.03-manual.patch65
-rw-r--r--SOURCES/bash-3.0-decl.patch12
-rw-r--r--SOURCES/bash-3.0-evalexp.patch15
-rw-r--r--SOURCES/bash-3.0-nfs_redir.patch152
-rw-r--r--SOURCES/bash-3.0-warn-locale.patch31
-rw-r--r--SOURCES/bash-3.2-2.4.4.patch144
-rw-r--r--SOURCES/bash-3.2-longjmp.dif45
-rw-r--r--SOURCES/bash-3.2-printf.patch34
-rw-r--r--SOURCES/bash-3.2-sigrestart.patch38
-rw-r--r--SOURCES/bash-4.0-async-bnc523667.dif18
-rw-r--r--SOURCES/bash-4.0-extended_quote.patch22
-rw-r--r--SOURCES/bash-4.0-headers.dif77
-rw-r--r--SOURCES/bash-4.0-loadables.dif754
-rw-r--r--SOURCES/bash-4.0-patches.tar.bz2bin0 -> 17535 bytes
-rw-r--r--SOURCES/bash-4.0-security.patch85
-rw-r--r--SOURCES/bash-4.0-setlocale.dif39
-rw-r--r--SOURCES/bash-4.0.10-typo.patch22
-rw-r--r--SOURCES/bash-4.0.24-acl.dif61
-rw-r--r--SOURCES/bash-4.0.dif282
-rw-r--r--SOURCES/bash-4.0.tar.bz2bin0 -> 4706830 bytes
-rw-r--r--SOURCES/bash-rpmlintrc2
-rw-r--r--SOURCES/dot.bashrc28
-rw-r--r--SOURCES/dot.profile28
-rw-r--r--SOURCES/readline-4.3-input.dif50
-rw-r--r--SOURCES/readline-5.2-conf.patch124
-rw-r--r--SOURCES/readline-6.0-destdir.patch191
-rw-r--r--SOURCES/readline-6.0-metamode.patch11
-rw-r--r--SOURCES/readline-6.0-patches.tar.bz2bin0 -> 2635 bytes
-rw-r--r--SOURCES/readline-6.0-wrap.patch16
-rw-r--r--SOURCES/readline-6.0.dif139
-rw-r--r--SOURCES/readline-6.0.tar.bz2bin0 -> 1905460 bytes
-rw-r--r--SOURCES/run-tests29
32 files changed, 2514 insertions, 0 deletions
diff --git a/SOURCES/bash-2.03-manual.patch b/SOURCES/bash-2.03-manual.patch
new file mode 100644
index 0000000..fd085d2
--- /dev/null
+++ b/SOURCES/bash-2.03-manual.patch
@@ -0,0 +1,65 @@
+Index: doc/bash.1
+===================================================================
+--- doc/bash.1.orig
++++ doc/bash.1
+@@ -115,6 +115,12 @@ processing, then commands are read from
+ This option allows the positional parameters to be set
+ when invoking an interactive shell.
+ .TP
++.B \-v
++Print shell input lines as they are read.
++.TP
++.B \-x
++Print commands and their arguments as they are executed.
++.TP
+ .B \-D
+ A list of all double-quoted strings preceded by \fB$\fP
+ is printed on the standard output.
+@@ -6211,6 +6217,11 @@ Apply the following `\fBs\fP' modifier o
+ .SH "SHELL BUILTIN COMMANDS"
+ .\" start of bash_builtins
+ .zZ
++.if !dFN \{\
++.de FN
++\fI\|\\$1\|\fP
++..
++.\}
+ .PP
+ Unless otherwise noted, each builtin command documented in this
+ section as accepting options preceded by
+@@ -9205,6 +9216,11 @@ process or job waited for.
+ .SH "RESTRICTED SHELL"
+ .\" rbash.1
+ .zY
++.if !dFN \{\
++.de FN
++\fI\|\\$1\|\fP
++..
++.\}
+ .PP
+ If
+ .B bash
+Index: doc/builtins.1
+===================================================================
+--- doc/builtins.1.orig
++++ doc/builtins.1
+@@ -12,6 +12,6 @@ shift, shopt, source, suspend, test, tim
+ ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
+ .SH BASH BUILTIN COMMANDS
+ .nr zZ 1
+-.so bash.1
++.so /usr/share/man/man1/bash.1
+ .SH SEE ALSO
+ bash(1), sh(1)
+Index: doc/rbash.1
+===================================================================
+--- doc/rbash.1.orig
++++ doc/rbash.1
+@@ -3,6 +3,6 @@
+ rbash \- restricted bash, see \fBbash\fR(1)
+ .SH RESTRICTED SHELL
+ .nr zY 1
+-.so bash.1
++.so /usr/share/man/man1/bash.1
+ .SH SEE ALSO
+ bash(1)
diff --git a/SOURCES/bash-3.0-decl.patch b/SOURCES/bash-3.0-decl.patch
new file mode 100644
index 0000000..8994ae1
--- /dev/null
+++ b/SOURCES/bash-3.0-decl.patch
@@ -0,0 +1,12 @@
+Index: support/printenv.c
+===================================================================
+--- support/printenv.c.orig
++++ support/printenv.c
+@@ -30,6 +30,7 @@
+
+ #include "bashansi.h"
+
++#include <string.h>
+ extern char **environ;
+
+ int
diff --git a/SOURCES/bash-3.0-evalexp.patch b/SOURCES/bash-3.0-evalexp.patch
new file mode 100644
index 0000000..797f121
--- /dev/null
+++ b/SOURCES/bash-3.0-evalexp.patch
@@ -0,0 +1,15 @@
+Index: expr.c
+===================================================================
+--- expr.c.orig
++++ expr.c
+@@ -410,8 +410,8 @@ expassign ()
+ value = expcond ();
+ if (curtok == EQ || curtok == OP_ASSIGN)
+ {
+- int special, op;
+- intmax_t lvalue;
++ int special, op = -1;
++ intmax_t lvalue = 0;
+
+ special = curtok == OP_ASSIGN;
+
diff --git a/SOURCES/bash-3.0-nfs_redir.patch b/SOURCES/bash-3.0-nfs_redir.patch
new file mode 100644
index 0000000..cd3f57c
--- /dev/null
+++ b/SOURCES/bash-3.0-nfs_redir.patch
@@ -0,0 +1,152 @@
+Index: redir.c
+===================================================================
+--- redir.c.orig
++++ redir.c
+@@ -176,12 +176,13 @@ redirection_error (temp, error)
+ how to undo the redirections later, if non-zero. If flags & RX_CLEXEC
+ is non-zero, file descriptors opened in do_redirection () have their
+ close-on-exec flag set. */
++static int close_before_dup2_err;
+ int
+ do_redirections (list, flags)
+ REDIRECT *list;
+ int flags;
+ {
+- int error;
++ int error, ret = 0;
+ REDIRECT *temp;
+
+ if (flags & RX_UNDOABLE)
+@@ -197,14 +198,21 @@ do_redirections (list, flags)
+
+ for (temp = list; temp; temp = temp->next)
+ {
++ close_before_dup2_err = 0;
+ error = do_redirection_internal (temp, flags);
+ if (error)
+ {
+ redirection_error (temp, error);
+ return (error);
+ }
++ if (close_before_dup2_err)
++ {
++ redirection_error (temp, close_before_dup2_err);
++ ret = close_before_dup2_err;
++ }
+ }
+- return (0);
++
++ return (ret);
+ }
+
+ /* Return non-zero if the redirection pointed to by REDIRECT has a
+@@ -786,6 +794,8 @@ do_redirection_internal (redirect, flags
+ #if defined (BUFFERED_INPUT)
+ check_bash_input (redirector);
+ #endif
++ if ((fd != redirector) && (close(redirector) < 0) && (errno != EBADF))
++ close_before_dup2_err = errno;
+
+ /* Make sure there is no pending output before we change the state
+ of the underlying file descriptor, since the builtins use stdio
+@@ -879,6 +889,9 @@ do_redirection_internal (redirect, flags
+ #if defined (BUFFERED_INPUT)
+ check_bash_input (redirector);
+ #endif
++ if ((fd != redirector) && (close(redirector) < 0) && (errno != EBADF))
++ close_before_dup2_err = errno;
++
+ if (fd != redirector && dup2 (fd, redirector) < 0)
+ {
+ r = errno;
+@@ -920,6 +933,9 @@ do_redirection_internal (redirect, flags
+ #if defined (BUFFERED_INPUT)
+ check_bash_input (redirector);
+ #endif
++ if ((close(redirector) < 0) && (errno != EBADF))
++ close_before_dup2_err = errno;
++
+ /* This is correct. 2>&1 means dup2 (1, 2); */
+ if (dup2 (redir_fd, redirector) < 0)
+ return (errno);
+Index: execute_cmd.c
+===================================================================
+--- execute_cmd.c.orig
++++ execute_cmd.c
+@@ -121,7 +121,7 @@ static void close_pipes __P((int, int));
+ static void do_piping __P((int, int));
+ static void bind_lastarg __P((char *));
+ static int shell_control_structure __P((enum command_type));
+-static void cleanup_redirects __P((REDIRECT *));
++static int cleanup_redirects __P((REDIRECT *));
+
+ #if defined (JOB_CONTROL)
+ static int restore_signal_mask __P((sigset_t *));
+@@ -417,12 +417,13 @@ shell_control_structure (type)
+
+ /* A function to use to unwind_protect the redirection undo list
+ for loops. */
+-static void
++static int
+ cleanup_redirects (list)
+ REDIRECT *list;
+ {
+- do_redirections (list, RX_ACTIVE);
++ int ret = do_redirections (list, RX_ACTIVE);
+ dispose_redirects (list);
++ return (ret ? 1 : 0);
+ }
+
+ #if 0
+@@ -664,7 +665,7 @@ execute_command_internal (command, async
+ redirection.) */
+ if (do_redirections (command->redirects, RX_ACTIVE|RX_UNDOABLE) != 0)
+ {
+- cleanup_redirects (redirection_undo_list);
++ (void)cleanup_redirects (redirection_undo_list);
+ redirection_undo_list = (REDIRECT *)NULL;
+ dispose_exec_redirects ();
+ return (last_command_exit_value = EXECUTION_FAILURE);
+@@ -3314,7 +3315,7 @@ execute_null_command (redirects, pipe_in
+ REDIRECT *redirects;
+ int pipe_in, pipe_out, async;
+ {
+- int r;
++ int r, s;
+
+ if (pipe_in != NO_PIPE || pipe_out != NO_PIPE || async)
+ {
+@@ -3361,10 +3362,10 @@ execute_null_command (redirects, pipe_in
+ substitution. Otherwise, return EXECUTION_SUCCESS. */
+
+ r = do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE);
+- cleanup_redirects (redirection_undo_list);
++ s = cleanup_redirects (redirection_undo_list);
+ redirection_undo_list = (REDIRECT *)NULL;
+
+- if (r != 0)
++ if (r != 0 || s != 0)
+ return (EXECUTION_FAILURE);
+ else if (last_command_subst_pid != NO_PID)
+ return (last_command_exit_value);
+@@ -4238,7 +4239,7 @@ execute_builtin_or_function (words, buil
+
+ if (do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE) != 0)
+ {
+- cleanup_redirects (redirection_undo_list);
++ (void)cleanup_redirects (redirection_undo_list);
+ redirection_undo_list = (REDIRECT *)NULL;
+ dispose_exec_redirects ();
+ return (EX_REDIRFAIL); /* was EXECUTION_FAILURE */
+@@ -4299,8 +4300,10 @@ execute_builtin_or_function (words, buil
+
+ if (redirection_undo_list)
+ {
+- cleanup_redirects (redirection_undo_list);
++ int ret = cleanup_redirects (redirection_undo_list);
+ redirection_undo_list = (REDIRECT *)NULL;
++ if (result == 0)
++ result = ret;
+ }
+
+ return (result);
diff --git a/SOURCES/bash-3.0-warn-locale.patch b/SOURCES/bash-3.0-warn-locale.patch
new file mode 100644
index 0000000..1773510
--- /dev/null
+++ b/SOURCES/bash-3.0-warn-locale.patch
@@ -0,0 +1,31 @@
+Index: locale.c
+===================================================================
+--- locale.c.orig
++++ locale.c
+@@ -29,6 +29,10 @@
+ #include "bashintl.h"
+ #include "bashansi.h"
+ #include <stdio.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++#include <errno.h>
+ #include "chartypes.h"
+ #include <errno.h>
+
+@@ -68,6 +72,15 @@ void
+ set_default_locale ()
+ {
+ #if defined (HAVE_SETLOCALE)
++ struct stat st;
++
++ if (stat("/usr/lib/locale/locale-archive", &st) == 0 && st.st_size == 0) {
++ errno = EINVAL;
++ sys_error("set_default_locale: broken locale");
++ fprintf (stderr, "%s: Please remove /usr/lib/locale/locale-archive\n",
++ get_name_for_error());
++ sleep(1);
++ }
+ default_locale = setlocale (LC_ALL, "");
+ if (default_locale)
+ default_locale = savestring (default_locale);
diff --git a/SOURCES/bash-3.2-2.4.4.patch b/SOURCES/bash-3.2-2.4.4.patch
new file mode 100644
index 0000000..3f34241
--- /dev/null
+++ b/SOURCES/bash-3.2-2.4.4.patch
@@ -0,0 +1,144 @@
+Index: array.c
+===================================================================
+--- array.c.orig
++++ array.c
+@@ -877,7 +877,7 @@ char *s, *sep;
+ * To make a running version, compile -DTEST_ARRAY and link with:
+ * xmalloc.o syntax.o lib/malloc/libmalloc.a lib/sh/libsh.a
+ */
+-int interrupt_immediately = 0;
++volatile sig_atomic_t interrupt_immediately = 0;
+
+ int
+ signal_is_trapped(s)
+Index: hashlib.c
+===================================================================
+--- hashlib.c.orig
++++ hashlib.c
+@@ -381,7 +381,7 @@ hash_pstats (table, name)
+
+ HASH_TABLE *table, *ntable;
+
+-int interrupt_immediately = 0;
++volatile sig_atomic_t interrupt_immediately = 0;
+
+ int
+ signal_is_trapped (s)
+Index: jobs.c
+===================================================================
+--- jobs.c.orig
++++ jobs.c
+@@ -1735,6 +1735,15 @@ make_child (command, async_p)
+ pid_t mypid;
+
+ mypid = getpid ();
++
++ if (interrupt_state)
++ {
++ struct timeval tv;
++ struct rusage rx;
++ (void) gettimeofday(&tv, NULL);
++ (void) getrusage(RUSAGE_SELF, &rx);
++ }
++
+ #if defined (BUFFERED_INPUT)
+ /* Close default_buffered_input if it's > 0. We don't close it if it's
+ 0 because that's the file descriptor used when redirecting input,
+Index: quit.h
+===================================================================
+--- quit.h.orig
++++ quit.h
+@@ -21,9 +21,13 @@
+ #if !defined (_QUIT_H_)
+ #define _QUIT_H_
+
++#define __need_sig_atomic_t
++#include <signal.h>
++#undef __need_sig_atomic_t
++
+ /* Non-zero means SIGINT has already ocurred. */
+-extern volatile int interrupt_state;
+-extern volatile int terminating_signal;
++extern volatile sig_atomic_t interrupt_state;
++extern volatile sig_atomic_t terminating_signal;
+
+ /* Macro to call a great deal. SIGINT just sets the interrupt_state variable.
+ When it is safe, put QUIT in the code, and the "interrupt" will take
+Index: sig.c
+===================================================================
+--- sig.c.orig
++++ sig.c
+@@ -61,13 +61,13 @@ extern int comsub_ignore_return;
+ extern int parse_and_execute_level, shell_initialized;
+
+ /* Non-zero after SIGINT. */
+-volatile int interrupt_state = 0;
++volatile sig_atomic_t interrupt_state = 0;
+
+ /* Non-zero after SIGWINCH */
+-volatile int sigwinch_received = 0;
++volatile sig_atomic_t sigwinch_received = 0;
+
+ /* Set to the value of any terminating signal received. */
+-volatile int terminating_signal = 0;
++volatile sig_atomic_t terminating_signal = 0;
+
+ /* The environment at the top-level R-E loop. We use this in
+ the case of error return. */
+@@ -79,10 +79,10 @@ sigset_t top_level_mask;
+ #endif /* JOB_CONTROL */
+
+ /* When non-zero, we throw_to_top_level (). */
+-int interrupt_immediately = 0;
++volatile sig_atomic_t interrupt_immediately = 0;
+
+ /* When non-zero, we call the terminating signal handler immediately. */
+-int terminate_immediately = 0;
++volatile sig_atomic_t terminate_immediately = 0;
+
+ #if defined (SIGWINCH)
+ static SigHandler *old_winch = (SigHandler *)SIG_DFL;
+Index: sig.h
+===================================================================
+--- sig.h.orig
++++ sig.h
+@@ -108,11 +108,15 @@ do { \
+
+ #endif /* JOB_CONTROL */
+
++#define __need_sig_atomic_t
++#include <signal.h>
++#undef __need_sig_atomic_t
++
+ /* Extern variables */
+-extern volatile int sigwinch_received;
++extern volatile sig_atomic_t sigwinch_received;
+
+-extern int interrupt_immediately;
+-extern int terminate_immediately;
++extern volatile sig_atomic_t interrupt_immediately;
++extern volatile sig_atomic_t terminate_immediately;
+
+ /* Functions from sig.c. */
+ extern sighandler termsig_sighandler __P((int));
+Index: examples/loadables/tee.c
+===================================================================
+--- examples/loadables/tee.c.orig
++++ examples/loadables/tee.c
+@@ -35,6 +35,7 @@
+ #include "bashansi.h"
+
+ #include <stdio.h>
++#include <signal.h>
+ #include <errno.h>
+
+ #include "builtins.h"
+@@ -56,7 +57,7 @@ static FLIST *tee_flist;
+
+ #define TEE_BUFSIZE 8192
+
+-extern int interrupt_immediately;
++extern volatile sig_atomic_t interrupt_immediately;
+
+ extern char *strerror ();
+
diff --git a/SOURCES/bash-3.2-longjmp.dif b/SOURCES/bash-3.2-longjmp.dif
new file mode 100644
index 0000000..cb5ed4f
--- /dev/null
+++ b/SOURCES/bash-3.2-longjmp.dif
@@ -0,0 +1,45 @@
+Index: execute_cmd.c
+===================================================================
+--- execute_cmd.c.orig
++++ execute_cmd.c
+@@ -25,6 +25,7 @@
+ #endif /* _AIX && RISC6000 && !__GNUC__ */
+
+ #include <stdio.h>
++#include <paths.h>
+ #include "chartypes.h"
+ #include "bashtypes.h"
+ #if !defined (_MINIX) && defined (HAVE_SYS_FILE_H)
+@@ -4764,6 +4765,23 @@ shell_execve (command, args, env)
+ /* We have committed to attempting to execute the contents of this file
+ as shell commands. */
+
++#if 1
++ larray = strvec_len(args) + 1;
++ args = strvec_resize(args, larray + 1);
++
++ for (i = larray - 1; i; i--)
++ args[i] = args[i - 1];
++
++ args[0] = savestring(_PATH_BSHELL);
++ args[1] = command;
++ args[larray] = (char *)0;
++
++ SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */
++ execve ("/bin/sh", args, env);
++ SETOSTYPE (1);
++
++ internal_error (_("%s: cannot execute: %s"), command, strerror (errno));
++#else
+ initialize_subshell ();
+
+ set_sigint_handler ();
+@@ -4806,6 +4824,8 @@ shell_execve (command, args, env)
+
+ longjmp (subshell_top_level, 1);
+ /*NOTREACHED*/
++#endif
++ return (EX_NOEXEC);
+ }
+
+ static int
diff --git a/SOURCES/bash-3.2-printf.patch b/SOURCES/bash-3.2-printf.patch
new file mode 100644
index 0000000..65cfa06
--- /dev/null
+++ b/SOURCES/bash-3.2-printf.patch
@@ -0,0 +1,34 @@
+Index: builtins/printf.def
+===================================================================
+--- builtins/printf.def.orig
++++ builtins/printf.def
+@@ -47,6 +47,7 @@ error occurs.
+ $END
+
+ #include <config.h>
++#include <locale.h>
+
+ #include "../bashtypes.h"
+
+@@ -529,12 +530,20 @@ printf_builtin (list)
+ case 'A':
+ #endif
+ {
+- char *f;
++ char *f, *lce = getenv("LC_NUMERIC"), *lcl = setlocale(LC_NUMERIC, NULL);
+ floatmax_t p;
+
+ p = getfloatmax ();
+ f = mklong (start, FLOATMAX_CONV, sizeof(FLOATMAX_CONV) - 1);
++
++ if (lce && lcl)
++ setlocale(LC_NUMERIC, lce);
++
+ PF (f, p);
++
++ if (lce && lcl)
++ setlocale(LC_NUMERIC, lcl);
++
+ break;
+ }
+
diff --git a/SOURCES/bash-3.2-sigrestart.patch b/SOURCES/bash-3.2-sigrestart.patch
new file mode 100644
index 0000000..7520861
--- /dev/null
+++ b/SOURCES/bash-3.2-sigrestart.patch
@@ -0,0 +1,38 @@
+Index: jobs.c
+===================================================================
+--- jobs.c.orig
++++ jobs.c
+@@ -2417,7 +2417,11 @@ wait_for (pid)
+ act.sa_handler = SIG_DFL;
+ sigemptyset (&act.sa_mask);
+ sigemptyset (&oact.sa_mask);
++# if defined(MUST_REINSTALL_SIGHANDLERS)
+ act.sa_flags = 0;
++# else
++ act.sa_flags = SA_RESTART;
++# endif
+ sigaction (SIGCHLD, &act, &oact);
+ # endif
+ queue_sigchld = 1;
+Index: sig.c
+===================================================================
+--- sig.c.orig
++++ sig.c
+@@ -654,6 +654,17 @@ set_signal_handler (sig, handler)
+ act.sa_flags |= SA_INTERRUPT; /* XXX */
+ else
+ act.sa_flags |= SA_RESTART; /* XXX */
++#else
++# if !defined(MUST_REINSTALL_SIGHANDLERS)
++ if (sig != SIGALRM)
++ act.sa_flags |= SA_RESTART; /* XXX */
++ if (handler == (trap_handler))
++ act.sa_flags |= SA_NODEFER; /* XXX */
++ if (handler == (termsig_sighandler))
++ act.sa_flags |= SA_NODEFER; /* XXX */
++ if (sig == SIGTSTP || sig == SIGTTOU || sig == SIGTTIN || sig == SIGCONT)
++ act.sa_flags |= SA_NODEFER; /* XXX */
++# endif
+ #endif
+ sigemptyset (&act.sa_mask);
+ sigemptyset (&oact.sa_mask);
diff --git a/SOURCES/bash-4.0-async-bnc523667.dif b/SOURCES/bash-4.0-async-bnc523667.dif
new file mode 100644
index 0000000..1b4e162
--- /dev/null
+++ b/SOURCES/bash-4.0-async-bnc523667.dif
@@ -0,0 +1,18 @@
+--- jobs.c
++++ jobs.c 2009-09-09 17:38:46.286401756 +0200
+@@ -626,6 +626,7 @@ stop_pipeline (async, deferred)
+ if (newjob)
+ {
+ newjob->flags |= J_FOREGROUND;
++#if !defined(__linux__)
+ /*
+ * !!!!! NOTE !!!!! (chet@ins.cwru.edu)
+ *
+@@ -640,6 +641,7 @@ stop_pipeline (async, deferred)
+ */
+ if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0)
+ maybe_give_terminal_to (shell_pgrp, newjob->pgrp, 0);
++#endif
+ }
+ }
+
diff --git a/SOURCES/bash-4.0-extended_quote.patch b/SOURCES/bash-4.0-extended_quote.patch
new file mode 100644
index 0000000..a39d81d
--- /dev/null
+++ b/SOURCES/bash-4.0-extended_quote.patch
@@ -0,0 +1,22 @@
+Index: parse.y
+===================================================================
+--- parse.y.orig
++++ parse.y
+@@ -3106,7 +3106,7 @@ parse_matched_pair (qc, open, close, len
+ ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
+ xfree (nestret);
+
+- if ((rflags & P_DQUOTE) == 0)
++ if (extended_quote || (rflags & P_DQUOTE) == 0)
+ {
+ nestret = sh_single_quote (ttrans);
+ free (ttrans);
+@@ -3517,7 +3517,7 @@ eof_error:
+ ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
+ xfree (nestret);
+
+- if ((rflags & P_DQUOTE) == 0)
++ if (extended_quote || (rflags & P_DQUOTE) == 0)
+ {
+ nestret = sh_single_quote (ttrans);
+ free (ttrans);
diff --git a/SOURCES/bash-4.0-headers.dif b/SOURCES/bash-4.0-headers.dif
new file mode 100644
index 0000000..0acbfe0
--- /dev/null
+++ b/SOURCES/bash-4.0-headers.dif
@@ -0,0 +1,77 @@
+Index: examples/loadables/Makefile.in
+===================================================================
+--- examples/loadables/Makefile.in.orig
++++ examples/loadables/Makefile.in
+@@ -28,6 +28,9 @@ includedir = @includedir@
+
+ datarootdir = @datarootdir@
+
++# Support an alternate destination root directory for package building
++DESTDIR =
++
+ topdir = @top_srcdir@
+ BUILD_DIR = @BUILD_DIR@
+ srcdir = @srcdir@
+@@ -61,6 +64,16 @@ LIBINTL_H = @LIBINTL_H@
+
+ CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS)
+
++INSTALL = @INSTALL@
++INSTALL_PROGRAM = @INSTALL_PROGRAM@
++INSTALL_SCRIPT = @INSTALL_SCRIPT@
++INSTALL_DATA = @INSTALL_DATA@
++INSTALLMODE= -m 0755
++INSTALLMODE2 = -m 0555
++
++Name = bash
++Version = @BASHVERS@
++
+ #
+ # These values are generated for configure by ${topdir}/support/shobj-conf.
+ # If your system is not supported by that script, but includes facilities for
+@@ -79,20 +92,45 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/l
+ -I$(BASHINCDIR) -I$(BUILD_DIR) -I$(LIBBUILD) \
+ -I$(BUILD_DIR)/builtins $(INTL_INC)
+
++.SUFFIXES: .d
++.c.d:
++ $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -MM -MT install-headers -MF $@ $<
++
+ .c.o:
+ $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $<
+
++SUPPORT_SRC = $(topdir)/support/
+
+ ALLPROG = print sleep finfo logname basename dirname \
+ tty pathchk tee head mkdir rmdir printenv id whoami \
+ uname sync push ln unlink cut realpath getconf strftime mypid
+ OTHERPROG = necho hello cat
++HEADERS =
+
+ all: $(SHOBJ_STATUS)
+
+ supported: $(ALLPROG)
+ others: $(OTHERPROG)
+
++dependlist: template.d
++-include template.d
++install-headers: HEADERS = $(sort $(filter %.h,$(realpath $^)))
++install-headers:
++ @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(includedir)/$(Name)/$(Version)/builtins
++ for head in $(subst $(realpath $(topdir))/,,$(HEADERS)) ; do \
++ case $$head in \
++ builtins/*) dest=$(DESTDIR)$(includedir)/$(Name)/$(Version)/builtins ;; \
++ *) dest=$(DESTDIR)$(includedir)/$(Name)/$(Version) ;; \
++ esac; \
++ $(INSTALL_DATA) -t $$dest $(topdir)/$$head; \
++ done
++
++install-plugins: $(ALLPROG)
++ @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(libdir)/$(Name)/$(Version)
++ for plugin in $(ALLPROG) ; do \
++ $(INSTALL) $$plugin $(DESTDIR)$(libdir)/$(Name)/$(Version)/$$plugin.so ; \
++ done
++
+ unsupported:
+ @echo "Your system (${host_os}) is not supported by the"
+ @echo "${topdir}/support/shobj-conf script."
diff --git a/SOURCES/bash-4.0-loadables.dif b/SOURCES/bash-4.0-loadables.dif
new file mode 100644
index 0000000..83ec6fc
--- /dev/null
+++ b/SOURCES/bash-4.0-loadables.dif
@@ -0,0 +1,754 @@
+Index: examples/loadables/Makefile.in
+===================================================================
+--- examples/loadables/Makefile.in.orig
++++ examples/loadables/Makefile.in
+@@ -83,7 +83,7 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/l
+ $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $<
+
+
+-ALLPROG = print truefalse sleep pushd finfo logname basename dirname \
++ALLPROG = print sleep finfo logname basename dirname \
+ tty pathchk tee head mkdir rmdir printenv id whoami \
+ uname sync push ln unlink cut realpath getconf strftime mypid
+ OTHERPROG = necho hello cat
+Index: examples/loadables/basename.c
+===================================================================
+--- examples/loadables/basename.c.orig
++++ examples/loadables/basename.c
+@@ -9,10 +9,13 @@
+ #endif
+
+ #include <stdio.h>
+-#include "builtins.h"
+ #include "shell.h"
+ #include "common.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+
++int
+ basename_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/cat.c
+===================================================================
+--- examples/loadables/cat.c.orig
++++ examples/loadables/cat.c
+@@ -25,8 +25,10 @@
+ #include <fcntl.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+
+ #ifndef errno
+ extern int errno;
+Index: examples/loadables/cut.c
+===================================================================
+--- examples/loadables/cut.c.orig
++++ examples/loadables/cut.c
+@@ -60,8 +60,10 @@ static const char sccsid[] = "@(#)cut.c
+ # include <unistd.h>
+ #endif
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -244,7 +246,7 @@ c_cut(fp, fname)
+ pos = positions + 1;
+ for (col = maxval; col; --col) {
+ if ((ch = getc(fp)) == EOF)
+- return;
++ return (0);
+ if (ch == '\n')
+ break;
+ if (*pos++)
+Index: examples/loadables/dirname.c
+===================================================================
+--- examples/loadables/dirname.c.orig
++++ examples/loadables/dirname.c
+@@ -27,10 +27,13 @@
+ #endif
+
+ #include <stdio.h>
+-#include "builtins.h"
+ #include "shell.h"
+ #include "common.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+
++int
+ dirname_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/finfo.c
+===================================================================
+--- examples/loadables/finfo.c.orig
++++ examples/loadables/finfo.c
+@@ -20,6 +20,8 @@
+ #include "bashansi.h"
+ #include "shell.h"
+ #include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "common.h"
+
+ #ifndef errno
+@@ -81,7 +83,7 @@ int argc;
+ char **argv;
+ {
+ register int i;
+- int mode, flags, opt;
++ int flags, opt;
+
+ sh_optind = 0; /* XXX */
+ prog = base_pathname(argv[0]);
+@@ -174,7 +176,7 @@ int m;
+ return (m & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID));
+ }
+
+-static int
++static void
+ perms(m)
+ int m;
+ {
+@@ -218,7 +220,7 @@ int m;
+ printf ("u=%s,g=%s,o=%s", ubits, gbits, obits);
+ }
+
+-static int
++static void
+ printmode(mode)
+ int mode;
+ {
+@@ -313,13 +315,13 @@ int flags;
+ else
+ printf("%ld\n", st->st_ctime);
+ } else if (flags & OPT_DEV)
+- printf("%d\n", st->st_dev);
++ printf("%lu\n", (ulong)st->st_dev);
+ else if (flags & OPT_INO)
+- printf("%d\n", st->st_ino);
++ printf("%lu\n", (ulong)st->st_ino);
+ else if (flags & OPT_FID)
+- printf("%d:%ld\n", st->st_dev, st->st_ino);
++ printf("%lu:%lu\n", (ulong)st->st_dev, (ulong)st->st_ino);
+ else if (flags & OPT_NLINK)
+- printf("%d\n", st->st_nlink);
++ printf("%lu\n", (ulong)st->st_nlink);
+ else if (flags & OPT_LNKNAM) {
+ #ifdef S_ISLNK
+ b = xmalloc(4096);
+@@ -369,7 +371,6 @@ finfo_builtin(list)
+ {
+ int c, r;
+ char **v;
+- WORD_LIST *l;
+
+ v = make_builtin_argv (list, &c);
+ r = finfo_main (c, v);
+Index: examples/loadables/getconf.c
+===================================================================
+--- examples/loadables/getconf.c.orig
++++ examples/loadables/getconf.c
+@@ -65,6 +65,8 @@
+ #include "bashansi.h"
+ #include "shell.h"
+ #include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "stdc.h"
+ #include "common.h"
+ #include "bashgetopt.h"
+@@ -1119,8 +1121,6 @@ static const struct conf_variable conf_t
+ { NULL }
+ };
+
+-static int num_getconf_variables = sizeof(conf_table) / sizeof(struct conf_variable) - 1;
+-
+ extern char *this_command_name;
+ extern char **make_builtin_argv ();
+
+@@ -1133,8 +1133,7 @@ int
+ getconf_builtin (list)
+ WORD_LIST *list;
+ {
+- int c, r, opt, aflag;
+- char **v;
++ int r, opt, aflag;
+
+ aflag = 0;
+ reset_internal_getopt();
+@@ -1169,7 +1168,6 @@ static void
+ getconf_help()
+ {
+ const struct conf_variable *cp;
+- register int i, column;
+
+ builtin_usage();
+ printf("Acceptable variable names are:\n");
+Index: examples/loadables/head.c
+===================================================================
+--- examples/loadables/head.c.orig
++++ examples/loadables/head.c
+@@ -38,6 +38,8 @@
+
+ #include "builtins.h"
+ #include "shell.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -88,8 +90,10 @@ file_head (fp, cnt)
+ break;
+ }
+ }
++ return EXECUTION_SUCCESS;
+ }
+
++int
+ head_builtin (list)
+ WORD_LIST *list;
+ {
+@@ -97,8 +101,6 @@ head_builtin (list)
+ WORD_LIST *l;
+ FILE *fp;
+
+- char *t;
+-
+ munge_list (list); /* change -num into -n num */
+
+ reset_internal_getopt ();
+Index: examples/loadables/hello.c
+===================================================================
+--- examples/loadables/hello.c.orig
++++ examples/loadables/hello.c
+@@ -11,8 +11,10 @@
+
+ #include <stdio.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+
+ /* A builtin `xxx' is normally implemented with an `xxx_builtin' function.
+Index: examples/loadables/id.c
+===================================================================
+--- examples/loadables/id.c.orig
++++ examples/loadables/id.c
+@@ -47,6 +47,8 @@ extern struct group *getgrgid ();
+
+ #include "shell.h"
+ #include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "stdc.h"
+ #include "common.h"
+ #include "bashgetopt.h"
+@@ -64,8 +66,6 @@ static int id_flags;
+ static uid_t ruid, euid;
+ static gid_t rgid, egid;
+
+-static char *id_user;
+-
+ static int inituser ();
+
+ static int id_pruser ();
+Index: examples/loadables/ln.c
+===================================================================
+--- examples/loadables/ln.c.orig
++++ examples/loadables/ln.c
+@@ -33,8 +33,10 @@
+ #include <stdio.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -50,6 +52,7 @@ typedef int unix_link_syscall_t __P((con
+ static unix_link_syscall_t *linkfn;
+ static int dolink ();
+
++int
+ ln_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/logname.c
+===================================================================
+--- examples/loadables/logname.c.orig
++++ examples/loadables/logname.c
+@@ -27,8 +27,10 @@
+ #include <stdio.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/common.h"
++#include "builtins/builtext.h"
+ #include "common.h"
+
+ #if !defined (errno)
+Index: examples/loadables/mkdir.c
+===================================================================
+--- examples/loadables/mkdir.c.orig
++++ examples/loadables/mkdir.c
+@@ -31,8 +31,10 @@
+ # include <unistd.h>
+ #endif
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -52,7 +54,7 @@ int
+ mkdir_builtin (list)
+ WORD_LIST *list;
+ {
+- int opt, pflag, omode, rval, octal, nmode, parent_mode, um;
++ int opt, pflag, omode, rval, octal, nmode, parent_mode;
+ char *mode;
+ WORD_LIST *l;
+
+@@ -169,7 +171,7 @@ make_path (path, nmode, parent_mode)
+ while (*p == '/')
+ p++;
+
+- while (p = strchr (p, '/'))
++ while ((p = strchr (p, '/')))
+ {
+ *p = '\0';
+ if (stat (npath, &sb) != 0)
+Index: examples/loadables/necho.c
+===================================================================
+--- examples/loadables/necho.c.orig
++++ examples/loadables/necho.c
+@@ -21,9 +21,15 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
+ #include <stdio.h>
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+
+ necho_builtin (list)
+ WORD_LIST *list;
+Index: examples/loadables/pathchk.c
+===================================================================
+--- examples/loadables/pathchk.c.orig
++++ examples/loadables/pathchk.c
+@@ -58,8 +58,10 @@
+ #include <stdio.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "stdc.h"
+ #include "bashgetopt.h"
+ #include "maxpath.h"
+@@ -98,6 +100,7 @@ extern char *strerror ();
+
+ static int validate_path ();
+
++int
+ pathchk_builtin (list)
+ WORD_LIST *list;
+ {
+@@ -278,7 +281,7 @@ validate_path (path, portability)
+ char *path;
+ int portability;
+ {
+- int path_max;
++ size_t path_max;
+ int last_elem; /* Nonzero if checking last element of path. */
+ int exists; /* 2 if the path element exists. */
+ char *slash;
+@@ -290,10 +293,8 @@ validate_path (path, portability)
+ if (*path == '\0')
+ return 0;
+
+-#ifdef lint
+ /* Suppress `used before initialized' warning. */
+ exists = 0;
+-#endif
+
+ /* Figure out the parent of the first element in PATH. */
+ parent = xstrdup (*path == '/' ? "/" : ".");
+@@ -370,7 +371,7 @@ validate_path (path, portability)
+ free (parent);
+ if (strlen (path) > path_max)
+ {
+- builtin_error ("path `%s' has length %d; exceeds limit of %d",
++ builtin_error ("path `%s' has length %zu; exceeds limit of %zu",
+ path, strlen (path), path_max);
+ return 1;
+ }
+Index: examples/loadables/print.c
+===================================================================
+--- examples/loadables/print.c.orig
++++ examples/loadables/print.c
+@@ -33,6 +33,8 @@
+ #include "bashansi.h"
+ #include "shell.h"
+ #include "builtins.h"
++#include "builtins/common.h"
++#include "builtins/builtext.h"
+ #include "stdc.h"
+ #include "bashgetopt.h"
+ #include "builtext.h"
+@@ -77,7 +79,7 @@ print_builtin (list)
+ {
+ int c, r, nflag, raw, ofd, sflag;
+ intmax_t lfd;
+- char **v, *pfmt, *arg;
++ char *pfmt;
+ WORD_LIST *l;
+
+ nflag = raw = sflag = 0;
+Index: examples/loadables/printenv.c
+===================================================================
+--- examples/loadables/printenv.c.orig
++++ examples/loadables/printenv.c
+@@ -26,8 +26,10 @@
+ #include <config.h>
+ #include <stdio.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+Index: examples/loadables/push.c
+===================================================================
+--- examples/loadables/push.c.orig
++++ examples/loadables/push.c
+@@ -25,8 +25,10 @@
+ #include <stdio.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "jobs.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+Index: examples/loadables/realpath.c
+===================================================================
+--- examples/loadables/realpath.c.orig
++++ examples/loadables/realpath.c
+@@ -49,8 +49,10 @@
+ #include <maxpath.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -60,6 +62,7 @@ extern int errno;
+
+ extern char *sh_realpath();
+
++int
+ realpath_builtin(list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/rmdir.c
+===================================================================
+--- examples/loadables/rmdir.c.orig
++++ examples/loadables/rmdir.c
+@@ -24,14 +24,17 @@
+
+ #include <stdio.h>
+ #include <errno.h>
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "common.h"
+
+ #if !defined (errno)
+ extern int errno;
+ #endif
+
++int
+ rmdir_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/sleep.c
+===================================================================
+--- examples/loadables/sleep.c.orig
++++ examples/loadables/sleep.c
+@@ -46,6 +46,8 @@
+
+ #include "shell.h"
+ #include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "common.h"
+
+ #define RETURN(x) \
+Index: examples/loadables/strftime.c
+===================================================================
+--- examples/loadables/strftime.c.orig
++++ examples/loadables/strftime.c
+@@ -31,8 +31,10 @@
+
+ #include <stdio.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "common.h"
+
+ int
+Index: examples/loadables/sync.c
+===================================================================
+--- examples/loadables/sync.c.orig
++++ examples/loadables/sync.c
+@@ -24,10 +24,13 @@
+ #include <unistd.h>
+ #endif
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+
++int
+ sync_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/tee.c
+===================================================================
+--- examples/loadables/tee.c.orig
++++ examples/loadables/tee.c
+@@ -38,8 +38,10 @@
+ #include <signal.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -61,6 +63,7 @@ extern volatile sig_atomic_t interrupt_i
+
+ extern char *strerror ();
+
++int
+ tee_builtin (list)
+ WORD_LIST *list;
+ {
+@@ -69,8 +72,6 @@ tee_builtin (list)
+ FLIST *fl;
+ char *buf, *bp;
+
+- char *t;
+-
+ reset_internal_getopt ();
+ append = nointr = 0;
+ tee_flist = (FLIST *)NULL;
+Index: examples/loadables/template.c
+===================================================================
+--- examples/loadables/template.c.orig
++++ examples/loadables/template.c
+@@ -11,8 +11,10 @@
+ #include <stdio.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+
+ #if !defined (errno)
+Index: examples/loadables/truefalse.c
+===================================================================
+--- examples/loadables/truefalse.c.orig
++++ examples/loadables/truefalse.c
+@@ -20,18 +20,24 @@
+
+ #include <config.h>
+
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
+ #include "bashtypes.h"
+ #include "shell.h"
+ #include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "common.h"
+
+-true_builtin (list)
++int true_builtin (list)
+ WORD_LIST *list;
+ {
+ return EXECUTION_SUCCESS;
+ }
+
+-false_builtin (list)
++int false_builtin (list)
+ WORD_LIST *list;
+ {
+ return EXECUTION_FAILURE;
+Index: examples/loadables/tty.c
+===================================================================
+--- examples/loadables/tty.c.orig
++++ examples/loadables/tty.c
+@@ -23,13 +23,16 @@
+ #include "config.h"
+
+ #include <stdio.h>
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+ extern char *ttyname ();
+
++int
+ tty_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/uname.c
+===================================================================
+--- examples/loadables/uname.c.orig
++++ examples/loadables/uname.c
+@@ -42,8 +42,10 @@ struct utsname {
+
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
+@@ -63,10 +65,11 @@ static void uprint();
+
+ static int uname_flags;
+
++int
+ uname_builtin (list)
+ WORD_LIST *list;
+ {
+- int opt, r;
++ int opt;
+ struct utsname uninfo;
+
+ uname_flags = 0;
+Index: examples/loadables/unlink.c
+===================================================================
+--- examples/loadables/unlink.c.orig
++++ examples/loadables/unlink.c
+@@ -30,14 +30,17 @@
+ #include <stdio.h>
+ #include <errno.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "common.h"
+
+ #ifndef errno
+ extern int errno;
+ #endif
+
++int
+ unlink_builtin (list)
+ WORD_LIST *list;
+ {
+Index: examples/loadables/whoami.c
+===================================================================
+--- examples/loadables/whoami.c.orig
++++ examples/loadables/whoami.c
+@@ -23,11 +23,14 @@
+ #include <config.h>
+ #include <stdio.h>
+
+-#include "builtins.h"
+ #include "shell.h"
++#include "builtins.h"
++#include "builtins/builtext.h"
++#include "builtins/common.h"
+ #include "bashgetopt.h"
+ #include "common.h"
+
++int
+ whoami_builtin (list)
+ WORD_LIST *list;
+ {
+Index: shell.h
+===================================================================
+--- shell.h.orig
++++ shell.h
+@@ -22,6 +22,9 @@
+ #include "config.h"
+ #endif
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ #include "bashjmp.h"
+
+ #include "command.h"
diff --git a/SOURCES/bash-4.0-patches.tar.bz2 b/SOURCES/bash-4.0-patches.tar.bz2
new file mode 100644
index 0000000..aa7f485
--- /dev/null
+++ b/SOURCES/bash-4.0-patches.tar.bz2
Binary files differ
diff --git a/SOURCES/bash-4.0-security.patch b/SOURCES/bash-4.0-security.patch
new file mode 100644
index 0000000..2b60b9d
--- /dev/null
+++ b/SOURCES/bash-4.0-security.patch
@@ -0,0 +1,85 @@
+Index: variables.c
+===================================================================
+--- variables.c.orig
++++ variables.c
+@@ -1203,6 +1203,7 @@ init_seconds_var ()
+ return v;
+ }
+
++#if !defined(linux)
+ /* The random number seed. You can change this by setting RANDOM. */
+ static unsigned long rseed = 1;
+ static int last_random_value;
+@@ -1256,6 +1257,24 @@ seedrand ()
+ sbrand (tv.tv_sec ^ tv.tv_usec ^ getpid ());
+ }
+
++#else
++
++static int last_sbrand_pid;
++
++static int brand ()
++{
++ return random() & 32767;
++}
++
++static void sbrand (unsigned long seed)
++{
++ srandom(seed);
++}
++
++static void
++seedrand () {}
++#endif
++
+ static SHELL_VAR *
+ assign_random (self, value, unused, key)
+ SHELL_VAR *self;
+@@ -1264,8 +1283,10 @@ assign_random (self, value, unused, key)
+ char *key;
+ {
+ sbrand (strtoul (value, (char **)NULL, 10));
++#if !defined(linux)
+ if (subshell_environment)
+ seeded_subshell = getpid ();
++#endif
+ return (self);
+ }
+
+@@ -1274,6 +1295,7 @@ get_random_number ()
+ {
+ int rv, pid;
+
++#if !defined(linux)
+ /* Reset for command and process substitution. */
+ pid = getpid ();
+ if (subshell_environment && seeded_subshell != pid)
+@@ -1285,6 +1307,18 @@ get_random_number ()
+ do
+ rv = brand ();
+ while (rv == last_random_value);
++#else
++ if (subshell_environment)
++ {
++ int mypid = getpid();
++ if (mypid != last_sbrand_pid)
++ {
++ last_sbrand_pid = mypid;
++ sbrand (mypid + NOW);
++ }
++ }
++ rv = brand();
++#endif
+ return rv;
+ }
+
+@@ -1296,7 +1330,9 @@ get_random (var)
+ char *p;
+
+ rv = get_random_number ();
++#if !defined(linux)
+ last_random_value = rv;
++#endif
+ p = itos (rv);
+
+ FREE (value_cell (var));
diff --git a/SOURCES/bash-4.0-setlocale.dif b/SOURCES/bash-4.0-setlocale.dif
new file mode 100644
index 0000000..cec7bc1
--- /dev/null
+++ b/SOURCES/bash-4.0-setlocale.dif
@@ -0,0 +1,39 @@
+Index: locale.c
+===================================================================
+--- locale.c.orig
++++ locale.c
+@@ -47,6 +47,7 @@ extern int dump_translatable_strings, du
+
+ /* The current locale when the program begins */
+ static char *default_locale;
++static char fallback[128];
+
+ /* The current domain for textdomain(3). */
+ static char *default_domain;
+@@ -314,11 +315,21 @@ get_locale_var (var)
+ if (locale == 0 || *locale == 0)
+ locale = lang;
+ if (locale == 0 || *locale == 0)
+-#if 0
+- locale = default_locale; /* system-dependent; not really portable. should it be "C"? */
+-#else
+- locale = "";
+-#endif
++ {
++ char *ptr;
++ if (default_locale && *default_locale && (ptr = strstr(default_locale, var)) && (ptr = strchr(ptr, '=')) && ++ptr)
++ {
++ memset (fallback, 0, sizeof(fallback));
++ strncpy(fallback, ptr, sizeof(fallback)-1);
++
++ if ((ptr = strchr(fallback, ';')))
++ *ptr = '\0';
++
++ locale = fallback;
++ }
++ else
++ locale = default_locale; /* system-dependent; not really portable. should it be "C"? */
++ }
+ return (locale);
+ }
+
diff --git a/SOURCES/bash-4.0.10-typo.patch b/SOURCES/bash-4.0.10-typo.patch
new file mode 100644
index 0000000..e92826c
--- /dev/null
+++ b/SOURCES/bash-4.0.10-typo.patch
@@ -0,0 +1,22 @@
+| Date: Sat, 14 Mar 2009 21:14:06 +0100
+| From: Andreas Schwab <schwab@linux-m68k.org>
+| To: bug-bash@gnu.org
+| Subject: [bash-bug] Doc typo
+|
+| A small typo in the bash doc.
+|
+| Andreas.
+|
+Index: doc/bashref.texi
+===================================================================
+--- doc/bashref.texi.orig
++++ doc/bashref.texi
+@@ -864,7 +864,7 @@ operator terminates a pattern list.
+ A list of patterns and an associated command-list is known
+ as a @var{clause}.
+
+-Each clause must be terminated with @samp{;;}, @samp{,&}, or @samp{;;&}.
++Each clause must be terminated with @samp{;;}, @samp{;&}, or @samp{;;&}.
+ The @var{word} undergoes tilde expansion, parameter expansion, command
+ substitution, arithmetic expansion, and quote removal before matching is
+ attempted. Each @var{pattern} undergoes tilde expansion, parameter
diff --git a/SOURCES/bash-4.0.24-acl.dif b/SOURCES/bash-4.0.24-acl.dif
new file mode 100644
index 0000000..5e7e1ed
--- /dev/null
+++ b/SOURCES/bash-4.0.24-acl.dif
@@ -0,0 +1,61 @@
+Index: findcmd.c
+===================================================================
+--- findcmd.c.orig
++++ findcmd.c
+@@ -93,7 +93,22 @@ file_status (name)
+
+ r = FS_EXISTS;
+
+-#if defined (AFS)
++#if defined (HAVE_EACCESS) /* FreeBSD, GLIBC_2.4+ */
++
++ /* For support of ACL's use eaccess(3) if found e.g. glibc 2.4 and up:
++ * Like access(2), euidaccess(3) checks permissions and existence of the
++ * file identified by its argument pathname. However, whereas access(2),
++ * performs checks using the real user and group identifiers of the pro-
++ * cess, euidaccess(3) uses the effective identifiers.
++ * eaccess(3) is a synonym for euidaccess(3), provided for compatibility
++ * with some other systems. */
++ if (eaccess (name, X_OK) == 0)
++ r |= FS_EXECABLE;
++ if (eaccess (name, R_OK) == 0)
++ r |= FS_READABLE;
++
++#elif defined (AFS)
++
+ /* We have to use access(2) to determine access because AFS does not
+ support Unix file system semantics. This may produce wrong
+ answers for non-AFS files when ruid != euid. I hate AFS. */
+@@ -102,8 +117,7 @@ file_status (name)
+ if (access (name, R_OK) == 0)
+ r |= FS_READABLE;
+
+- return r;
+-#else /* !AFS */
++#else /* !AFS && !HAVE_EACCESS */
+
+ /* Find out if the file is actually executable. By definition, the
+ only other criteria is that the file has an execute bit set that
+@@ -146,8 +160,8 @@ file_status (name)
+ r |= FS_READABLE;
+ }
+
++#endif /* !AFS && !HAVE_EACCESS */
+ return r;
+-#endif /* !AFS */
+ }
+
+ /* Return non-zero if FILE exists and is executable.
+Index: lib/sh/eaccess.c
+===================================================================
+--- lib/sh/eaccess.c.orig
++++ lib/sh/eaccess.c
+@@ -201,7 +201,7 @@ sh_eaccess (path, mode)
+ if (path_is_devfd (path))
+ return (sh_stataccess (path, mode));
+
+-#if defined (HAVE_EACCESS) /* FreeBSD */
++#if defined (HAVE_EACCESS) /* FreeBSD, GLIBC_2.4+ */
+ return (eaccess (path, mode));
+ #elif defined (EFF_ONLY_OK) /* SVR4(?), SVR4.2 */
+ return access (path, mode|EFF_ONLY_OK);
diff --git a/SOURCES/bash-4.0.dif b/SOURCES/bash-4.0.dif
new file mode 100644
index 0000000..f9bd897
--- /dev/null
+++ b/SOURCES/bash-4.0.dif
@@ -0,0 +1,282 @@
+Index: .pkgextract
+===================================================================
+--- /dev/null
++++ .pkgextract
+@@ -0,0 +1,14 @@
++tar Oxfj ../bash-4.0-patches.tar.bz2 | patch -p0 -s
++patch -p0 -s --suffix=".manual" < ../bash-2.03-manual.patch
++patch -p0 -s --suffix=".security" < ../bash-4.0-security.patch
++patch -p0 -s --suffix=".2.4.4" < ../bash-3.2-2.4.4.patch
++patch -p0 -s --suffix=".evalexp" < ../bash-3.0-evalexp.patch
++patch -p0 -s --suffix=".warnlc" < ../bash-3.0-warn-locale.patch
++patch -p0 -s --suffix=".nfs_redir"< ../bash-3.0-nfs_redir.patch
++patch -p0 -s --suffix=".decl" < ../bash-3.0-decl.patch
++patch -p0 -s --suffix=".equote" < ../bash-4.0-extended_quote.patch
++patch -p0 -s --suffix=".printf" < ../bash-3.2-printf.patch
++patch -p0 -s --suffix=".plugins" < ../bash-4.0-loadables.dif
++patch -p0 -s --suffix=".zerotty" < ../readline-4.3-input.dif
++patch -p0 -s --suffix=".wrap" < ../readline-6.0-wrap.patch
++patch -p0 -s --suffix=".conf" < ../readline-5.2-conf.patch
+Index: config-top.h
+===================================================================
+--- config-top.h.orig
++++ config-top.h
+@@ -54,14 +54,14 @@
+ /* The default value of the PATH variable. */
+ #ifndef DEFAULT_PATH_VALUE
+ #define DEFAULT_PATH_VALUE \
+- "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
++ "/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:."
+ #endif
+
+ /* The value for PATH when invoking `command -p'. This is only used when
+ the Posix.2 confstr () function, or CS_PATH define are not present. */
+ #ifndef STANDARD_UTILS_PATH
+ #define STANDARD_UTILS_PATH \
+- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
++ "/bin:/usr/bin:/sbin:/usr/sbin"
+ #endif
+
+ /* Default primary and secondary prompt strings. */
+@@ -75,20 +75,20 @@
+ #define KSH_COMPATIBLE_SELECT
+
+ /* System-wide .bashrc file for interactive shells. */
+-/* #define SYS_BASHRC "/etc/bash.bashrc" */
++#define SYS_BASHRC "/etc/bash.bashrc"
+
+ /* System-wide .bash_logout for login shells. */
+-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
++#define SYS_BASH_LOGOUT "/etc/bash.bash_logout"
+
+ /* Define this to make non-interactive shells begun with argv[0][0] == '-'
+ run the startup files when not in posix mode. */
+-/* #define NON_INTERACTIVE_LOGIN_SHELLS */
++#define NON_INTERACTIVE_LOGIN_SHELLS
+
+ /* Define this if you want bash to try to check whether it's being run by
+ sshd and source the .bashrc if so (like the rshd behavior). This checks
+ for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
+ which can be fooled under certain not-uncommon circumstances. */
+-/* #define SSH_SOURCE_BASHRC */
++#define SSH_SOURCE_BASHRC
+
+ /* Define if you want the case-capitalizing operators (~[~]) and the
+ `capcase' variable attribute (declare -c). */
+Index: general.h
+===================================================================
+--- general.h.orig
++++ general.h
+@@ -21,10 +21,13 @@
+ #if !defined (_GENERAL_H_)
+ #define _GENERAL_H_
+
++#include <time.h>
++#include <sys/types.h>
+ #include "stdc.h"
+
+ #include "bashtypes.h"
+ #include "chartypes.h"
++#include "bashline.h"
+
+ #if defined (HAVE_SYS_RESOURCE_H) && defined (RLIMTYPE)
+ # if defined (HAVE_SYS_TIME_H)
+Index: jobs.c
+===================================================================
+--- jobs.c.orig
++++ jobs.c
+@@ -199,10 +199,10 @@ int previous_job = NO_JOB;
+ #endif
+
+ /* Last child made by the shell. */
+-pid_t last_made_pid = NO_PID;
++volatile pid_t last_made_pid = NO_PID;
+
+ /* Pid of the last asynchronous child. */
+-pid_t last_asynchronous_pid = NO_PID;
++volatile pid_t last_asynchronous_pid = NO_PID;
+
+ /* The pipeline currently being built. */
+ PROCESS *the_pipeline = (PROCESS *)NULL;
+@@ -215,7 +215,7 @@ int already_making_children = 0;
+
+ /* If this is non-zero, $LINES and $COLUMNS are reset after every process
+ exits from get_tty_state(). */
+-int check_window_size;
++int check_window_size = 1;
+
+ /* Functions local to this file. */
+
+Index: jobs.h
+===================================================================
+--- jobs.h.orig
++++ jobs.h
+@@ -165,7 +165,7 @@ extern pid_t fork (), getpid (), getpgrp
+ extern struct jobstats js;
+
+ extern pid_t original_pgrp, shell_pgrp, pipeline_pgrp;
+-extern pid_t last_made_pid, last_asynchronous_pid;
++extern volatile pid_t last_made_pid, last_asynchronous_pid;
+ extern int asynchronous_notification;
+
+ extern JOB **jobs;
+Index: parse.y
+===================================================================
+--- parse.y.orig
++++ parse.y
+@@ -1283,7 +1283,7 @@ input_file_descriptor ()
+
+ #if defined (READLINE)
+ char *current_readline_prompt = (char *)NULL;
+-char *current_readline_line = (char *)NULL;
++unsigned char *current_readline_line = (unsigned char *)NULL;
+ int current_readline_line_index = 0;
+
+ static int
+Index: shell.c
+===================================================================
+--- shell.c.orig
++++ shell.c
+@@ -479,7 +479,7 @@ main (argc, argv, env)
+ if (dump_translatable_strings)
+ read_but_dont_execute = 1;
+
+- if (running_setuid && privileged_mode == 0)
++ if (running_setuid && privileged_mode == 0 /* && act_like_sh == 0 */)
+ disable_priv_mode ();
+
+ /* Need to get the argument to a -c option processed in the
+Index: subst.c
+===================================================================
+--- subst.c.orig
++++ subst.c
+@@ -2962,6 +2962,7 @@ call_expand_word_internal (w, q, i, c, e
+ last_command_exit_value = EXECUTION_FAILURE;
+ exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF);
+ /* NOTREACHED */
++ return NULL; /* make stupid compiler happy */
+ }
+ else
+ return (result);
+Index: builtins/shopt.def
+===================================================================
+--- builtins/shopt.def.orig
++++ builtins/shopt.def
+@@ -279,9 +279,9 @@ reset_shopt_options ()
+ allow_null_glob_expansion = glob_dot_filenames = 0;
+ cdable_vars = mail_warning = 0;
+ no_exit_on_failed_exec = print_shift_error = 0;
+- check_hashed_filenames = cdspelling = expand_aliases = check_window_size = 0;
++ check_hashed_filenames = cdspelling = expand_aliases = 0;
+
+- source_uses_path = promptvars = 1;
++ check_window_size = source_uses_path = promptvars = 1;
+
+ #if defined (EXTENDED_GLOB)
+ extended_glob = 0;
+Index: doc/Makefile.in
+===================================================================
+--- doc/Makefile.in.orig
++++ doc/Makefile.in
+@@ -142,7 +142,7 @@ BASHREF_FILES = $(srcdir)/bashref.texi $
+ ${RM} $@
+ -${DVIPS} $<
+
+-all: ps info dvi text html
++all: info html
+ nodvi: ps info text html
+ everything: all pdf
+
+Index: doc/bash.1
+===================================================================
+--- doc/bash.1.orig
++++ doc/bash.1
+@@ -4620,8 +4620,8 @@ file (the \fIinputrc\fP file).
+ The name of this file is taken from the value of the
+ .SM
+ .B INPUTRC
+-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
+ initialization file is read, and the key bindings and variables
+ are set.
+@@ -9340,6 +9340,9 @@ The individual login shell cleanup file,
+ .TP
+ .FN ~/.inputrc
+ Individual \fIreadline\fP initialization file
++.TP
++.FN /etc/inputrc
++System \fBreadline\fP initialization file
+ .PD
+ .SH AUTHORS
+ Brian Fox, Free Software Foundation
+Index: support/printenv.c
+===================================================================
+--- support/printenv.c.orig
++++ support/printenv.c
+@@ -27,6 +27,7 @@
+ #if defined (HAVE_CONFIG_H)
+ # include <config.h>
+ #endif
++#include <stdio.h>
+
+ #include "bashansi.h"
+
+Index: support/rlvers.sh
+===================================================================
+--- support/rlvers.sh.orig
++++ support/rlvers.sh
+@@ -27,10 +27,10 @@ TDIR=$TMPDIR/rlvers
+
+ # defaults
+ CC=cc
+-RL_LIBDIR=/usr/local/lib
+-RL_INCDIR=/usr/local/include
++RL_LIBDIR=/lib
++RL_INCDIR=/usr/include
+
+-TERMCAP_LIB="-ltermcap"
++TERMCAP_LIB="-lncurses"
+
+ # cannot rely on the presence of getopts
+ while [ $# -gt 0 ]; do
+Index: support/shobj-conf
+===================================================================
+--- support/shobj-conf.orig
++++ support/shobj-conf
+@@ -112,10 +112,11 @@ sunos5*|solaris2*)
+ linux*-*|gnu*-*|k*bsd*-gnu-*)
+ SHOBJ_CFLAGS=-fPIC
+ SHOBJ_LD='${CC}'
+- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
++ SHOBJ_LDFLAGS='-shared'
+
+- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++ SHLIB_XLDFLAGS='-Wl,-rpath-link,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
++ SHLIB_LIBS=-lncurses
+ ;;
+
+ freebsd2*)
+Index: tests/run-intl
+===================================================================
+--- tests/run-intl.orig
++++ tests/run-intl
+@@ -5,4 +5,4 @@ echo "warning: some of these tests will
+ echo "warning: locales installed on your system." >&2
+ echo "warning: please ignore any differences consisting only of white space" >&2
+ ${THIS_SH} ./intl.tests > /tmp/xx
+-diff $AFLAG /tmp/xx intl.right && rm -f /tmp/xx
++diff -w $AFLAG /tmp/xx intl.right && rm -f /tmp/xx
+Index: tests/run-read
+===================================================================
+--- tests/run-read.orig
++++ tests/run-read
+@@ -1,4 +1,4 @@
+ echo "warning: please do not consider output differing only in the amount of" >&2
+ echo "warning: white space to be an error." >&2
+ ${THIS_SH} ./read.tests > /tmp/xx 2>&1
+-diff /tmp/xx read.right && rm -f /tmp/xx
++diff -w /tmp/xx read.right && rm -f /tmp/xx
diff --git a/SOURCES/bash-4.0.tar.bz2 b/SOURCES/bash-4.0.tar.bz2
new file mode 100644
index 0000000..2c5fe5e
--- /dev/null
+++ b/SOURCES/bash-4.0.tar.bz2
Binary files differ
diff --git a/SOURCES/bash-rpmlintrc b/SOURCES/bash-rpmlintrc
new file mode 100644
index 0000000..db5425f
--- /dev/null
+++ b/SOURCES/bash-rpmlintrc
@@ -0,0 +1,2 @@
+addFilter(".*hidden-file-or-dir.*/etc/skel/\..*")
+addFilter(".*zero-length.*/etc/skel/\..*")
diff --git a/SOURCES/dot.bashrc b/SOURCES/dot.bashrc
new file mode 100644
index 0000000..8421175
--- /dev/null
+++ b/SOURCES/dot.bashrc
@@ -0,0 +1,28 @@
+# Sample .bashrc for SuSE Linux
+# Copyright (c) SuSE GmbH Nuernberg
+
+# There are 3 different types of shells in bash: the login shell, normal shell
+# and interactive shell. Login shells read ~/.profile and interactive shells
+# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
+# settings made here will also take effect in a login shell.
+#
+# NOTE: It is recommended to make language settings in ~/.profile rather than
+# here, since multilingual X sessions would not work properly if LANG is over-
+# ridden in every subshell.
+
+# Some applications read the EDITOR variable to determine your favourite text
+# editor. So uncomment the line below and enter the editor of your choice :-)
+#export EDITOR=/usr/bin/vim
+#export EDITOR=/usr/bin/mcedit
+
+# For some news readers it makes sense to specify the NEWSSERVER variable here
+#export NEWSSERVER=your.news.server
+
+# If you want to use a Palm device with Linux, uncomment the two lines below.
+# For some (older) Palm Pilots, you might need to set a lower baud rate
+# e.g. 57600 or 38400; lowest is 9600 (very slow!)
+#
+#export PILOTPORT=/dev/pilot
+#export PILOTRATE=115200
+
+test -s ~/.alias && . ~/.alias || true
diff --git a/SOURCES/dot.profile b/SOURCES/dot.profile
new file mode 100644
index 0000000..3da0215
--- /dev/null
+++ b/SOURCES/dot.profile
@@ -0,0 +1,28 @@
+# Sample .profile for SuSE Linux
+# rewritten by Christian Steinruecken <cstein@suse.de>
+#
+# This file is read each time a login shell is started.
+# All other interactive shells will only read .bashrc; this is particularly
+# important for language settings, see below.
+
+test -z "$PROFILEREAD" && . /etc/profile || true
+
+# Most applications support several languages for their output.
+# To make use of this feature, simply uncomment one of the lines below or
+# add your own one (see /usr/share/locale/locale.alias for more codes)
+# This overwrites the system default set in /etc/sysconfig/language
+# in the variable RC_LANG.
+#
+#export LANG=de_DE.UTF-8 # uncomment this line for German output
+#export LANG=fr_FR.UTF-8 # uncomment this line for French output
+#export LANG=es_ES.UTF-8 # uncomment this line for Spanish output
+
+
+# Some people don't like fortune. If you uncomment the following lines,
+# you will have a fortune each time you log in ;-)
+
+#if [ -x /usr/bin/fortune ] ; then
+# echo
+# /usr/bin/fortune
+# echo
+#fi
diff --git a/SOURCES/readline-4.3-input.dif b/SOURCES/readline-4.3-input.dif
new file mode 100644
index 0000000..5abe76e
--- /dev/null
+++ b/SOURCES/readline-4.3-input.dif
@@ -0,0 +1,50 @@
+Index: lib/readline/input.c
+===================================================================
+--- lib/readline/input.c.orig
++++ lib/readline/input.c
+@@ -459,6 +459,8 @@ rl_read_key ()
+ return (c);
+ }
+
++extern int _rl_read_zero_char_from_tty;
++
+ int
+ rl_getc (stream)
+ FILE *stream;
+@@ -482,7 +484,10 @@ rl_getc (stream)
+ /* If zero characters are returned, then the file that we are
+ reading from is empty! Return EOF in that case. */
+ if (result == 0)
+- return (EOF);
++ {
++ _rl_read_zero_char_from_tty = 1;
++ return (EOF);
++ }
+
+ #if defined (__BEOS__)
+ if (errno == EINTR)
+Index: lib/readline/readline.c
+===================================================================
+--- lib/readline/readline.c.orig
++++ lib/readline/readline.c
+@@ -469,6 +469,9 @@ _rl_internal_char_cleanup ()
+ _rl_erase_entire_line ();
+ }
+
++/* Catch EOF from tty, do not return command line */
++int _rl_read_zero_char_from_tty = 0;
++
+ STATIC_CALLBACK int
+ #if defined (READLINE_CALLBACKS)
+ readline_internal_char ()
+@@ -513,6 +516,10 @@ readline_internal_charloop ()
+ c = rl_read_key ();
+ RL_UNSETSTATE(RL_STATE_READCMD);
+
++ /* Return here if terminal is closed */
++ if (c == EOF && _rl_read_zero_char_from_tty)
++ return (rl_done = 1);
++
+ /* look at input.c:rl_getc() for the circumstances under which this will
+ be returned; punt immediately on read error without converting it to
+ a newline. */
diff --git a/SOURCES/readline-5.2-conf.patch b/SOURCES/readline-5.2-conf.patch
new file mode 100644
index 0000000..448efe1
--- /dev/null
+++ b/SOURCES/readline-5.2-conf.patch
@@ -0,0 +1,124 @@
+Index: lib/readline/bind.c
+===================================================================
+--- lib/readline/bind.c.orig
++++ lib/readline/bind.c
+@@ -751,6 +751,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;
+@@ -816,11 +819,14 @@ rl_re_read_init_file (count, ignore)
+ return r;
+ }
+
++/* Forward declarations */
++static int sv_bell_style PARAMS((const char *));
++
+ /* Do key bindings from a file. If FILENAME is NULL it defaults
+ 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
+ 4. /etc/inputrc
+ If the file existed and could be opened and read, 0 is returned,
+ otherwise errno is returned. */
+@@ -832,16 +838,37 @@ rl_read_init_file (filename)
+ if (filename == 0)
+ filename = last_readline_init_file;
+ if (filename == 0)
+- filename = sh_get_env_value ("INPUTRC");
++ {
++ filename = sh_get_env_value ("INPUTRC");
++ if (filename && !strncmp(SYS_INPUTRC, filename, strlen(SYS_INPUTRC)))
++ {
++ struct stat st;
++ char *default_inputrc = tilde_expand(DEFAULT_INPUTRC);
++
++ if ((stat(default_inputrc, &st) == 0))
++ {
++ filename = DEFAULT_INPUTRC;
++ read_system_init_file = 1;
++ }
++ else
++ read_system_init_file = 0;
++
++ free(default_inputrc);
++ }
++ else
++ read_system_init_file = 1;
++ }
+ if (filename == 0 || *filename == 0)
+ {
+ filename = DEFAULT_INPUTRC;
+- /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */
+- if (_rl_read_init_file (filename, 0) == 0)
+- return 0;
+- filename = SYS_INPUTRC;
++ read_system_init_file = 1;
+ }
+
++ sv_bell_style(sh_get_env_value("DEFAULT_BELL_STYLE"));
++
++ if (read_system_init_file)
++ _rl_read_init_file (SYS_INPUTRC, 1);
++
+ #if defined (__MSDOS__)
+ if (_rl_read_init_file (filename, 0) == 0)
+ return 0;
+@@ -1352,7 +1379,14 @@ rl_parse_and_bind (string)
+ rl_macro_bind (seq, &funname[1], _rl_keymap);
+ }
+ else
+- rl_bind_keyseq (seq, rl_named_function (funname));
++ {
++#if defined (PREFIX_META_HACK)
++ if (_rl_stricmp (funname, "prefix-meta") == 0)
++ rl_generic_bind (ISKMAP, seq, (char *)emacs_meta_keymap, _rl_keymap);
++ else
++#endif
++ rl_bind_keyseq (seq, rl_named_function (funname));
++ }
+
+ xfree (seq);
+ return 0;
+@@ -1490,7 +1524,6 @@ typedef int _rl_sv_func_t PARAMS((const
+ #define V_INT 2
+
+ /* Forward declarations */
+-static int sv_bell_style PARAMS((const char *));
+ static int sv_combegin PARAMS((const char *));
+ static int sv_dispprefix PARAMS((const char *));
+ static int sv_compquery PARAMS((const char *));
+Index: lib/readline/rlconf.h
+===================================================================
+--- lib/readline/rlconf.h.orig
++++ lib/readline/rlconf.h
+@@ -33,7 +33,7 @@
+ #define HANDLE_SIGNALS
+
+ /* Ugly but working hack for binding prefix meta. */
+-#define PREFIX_META_HACK
++#undef PREFIX_META_HACK
+
+ /* The next-to-last-ditch effort file name for a user-specific init file. */
+ #define DEFAULT_INPUTRC "~/.inputrc"
+Index: lib/readline/doc/rluser.texi
+===================================================================
+--- lib/readline/doc/rluser.texi.orig
++++ lib/readline/doc/rluser.texi
+@@ -347,7 +347,8 @@ file is taken from the value of the envi
+ @end ifclear
+ that variable is unset, the default is @file{~/.inputrc}. If that
+ file does not exist or cannot be read, the ultimate default is
+-@file{/etc/inputrc}.
++@file{/etc/inputrc}. If both @file{~/.inputrc} and @file{/etc/inputrc}
++exist Readline will read first @file{/etc/inputrc} and then @file{~/.inputrc}.
+
+ When a program which uses the Readline library starts up, the
+ init file is read, and the key bindings are set.
diff --git a/SOURCES/readline-6.0-destdir.patch b/SOURCES/readline-6.0-destdir.patch
new file mode 100644
index 0000000..55412c3
--- /dev/null
+++ b/SOURCES/readline-6.0-destdir.patch
@@ -0,0 +1,191 @@
+--- shlib/Makefile.in
++++ shlib/Makefile.in 2009-02-27 17:21:24.428797577 +0100
+@@ -58,6 +58,7 @@ bindir = @bindir@
+ libdir = @libdir@
+ datadir = @datadir@
+ localedir = @localedir@
++linkagedir = $(libdir)
+
+ # Support an alternate destination root directory for package building
+ DESTDIR =
+@@ -182,13 +183,13 @@ 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) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
+- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY)
++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE)
+ @echo install: you may need to run ldconfig
+
+ uninstall:
+- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY)
+- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE)
++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -U $(SHARED_HISTORY)
++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -U $(SHARED_READLINE)
+ @echo uninstall: you may need to run ldconfig
+
+ clean mostlyclean: force
+--- support/shlib-install
++++ support/shlib-install 2009-02-27 17:22:54.688001513 +0100
+@@ -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 [-b bin-dir] -i install-prog [-U] library
++# usage: shlib-install [-D] -O host_os -d installation-dir [-l linkage-dir] [-b bin-dir] -i install-prog [-U] library
+ #
+ # Chet Ramey
+ # chet@po.cwru.edu
+@@ -12,10 +12,12 @@
+ # defaults
+ #
+ INSTALLDIR=/usr/local/lib
++LINKAGEDIR=
+ LDCONFIG=ldconfig
++DESTDIR=
+
+ PROGNAME=`basename $0`
+-USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library"
++USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-l linkage-dir] [-b bin-dir] -i install-prog [-U] library"
+
+ # process options
+
+@@ -23,14 +25,19 @@ while [ $# -gt 0 ]; do
+ case "$1" in
+ -O) shift; host_os="$1"; shift ;;
+ -d) shift; INSTALLDIR="$1"; shift ;;
++ -dd) shift; DESTDIR=$1; shift ;;
+ -b) shift; BINDIR="$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
++if [ -z "$LINKAGEDIR" ]; then
++ LINKAGEDIR="$INSTALLDIR"
++fi
+
+ # set install target name
+ LIBNAME="$1"
+@@ -48,18 +55,18 @@ LN="ln -s"
+ # pre-install
+
+ if [ -z "$uninstall" ]; then
+- ${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+- if [ -f "$INSTALLDIR/$LIBNAME" ]; then
+- ${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
++ ${echo} $RM ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
++ if [ -f "${DESTDIR}$INSTALLDIR/$LIBNAME" ]; then
++ ${echo} $MV ${DESTDIR}$INSTALLDIR/$LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF}
+ fi
+ fi
+
+ # install/uninstall
+
+ if [ -z "$uninstall" ] ; then
+- ${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME}
++ ${echo} eval ${INSTALLPROG} $LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}
+ else
+- ${echo} ${RM} ${INSTALLDIR}/${LIBNAME}
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/${LIBNAME}
+ fi
+
+ # post-install/uninstall
+@@ -71,7 +78,7 @@ fi
+ case "$host_os" in
+ hpux*|darwin*|macosx*|linux*)
+ if [ -z "$uninstall" ]; then
+- chmod 555 ${INSTALLDIR}/${LIBNAME}
++ chmod 555 ${DESTDIR}${INSTALLDIR}/${LIBNAME}
+ fi ;;
+ cygwin*|mingw*)
+ IMPLIBNAME=`echo ${LIBNAME} \
+@@ -109,8 +116,8 @@ case "$LIBNAME" in
+ LINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]\.[0-9]:\1:'` # libname.dylib
+ esac
+
+-INSTALL_LINK1='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK1'
+-INSTALL_LINK2='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2'
++INSTALL_LINK1='${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK1'
++INSTALL_LINK2='${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2'
+
+ #
+ # Create symlinks to the installed library. This section is incomplete.
+@@ -118,27 +125,27 @@ INSTALL_LINK2='${echo} cd $INSTALLDIR &&
+ case "$host_os" in
+ *linux*)
+ # libname.so.M -> libname.so.M.N
+- ${echo} ${RM} ${INSTALLDIR}/$LINK2
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK2
+ fi
+
+ # libname.so -> libname.so.M
+- ${echo} ${RM} ${INSTALLDIR}/$LINK1
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
+ if [ -z "$uninstall" ]; then
+- ${echo} cd $INSTALLDIR && ${echo} ${LN} $LINK2 $LINK1
++ ${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LINK2 $LINK1
+ fi
+ ;;
+
+ bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu|netbsd*)
+ # libname.so.M -> libname.so.M.N
+- ${echo} ${RM} ${INSTALLDIR}/$LINK2
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK2
+ fi
+
+ # libname.so -> libname.so.M.N
+- ${echo} ${RM} ${INSTALLDIR}/$LINK1
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK1
+ fi
+@@ -146,7 +153,7 @@ bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu|
+
+ solaris2*|aix4.[2-9]*|aix[5-9]*|osf*|irix[56]*|sysv[45]*|dgux*|interix*)
+ # libname.so -> libname.so.M
+- ${echo} ${RM} ${INSTALLDIR}/$LINK1
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK1
+ fi
+@@ -157,19 +164,19 @@ solaris2*|aix4.[2-9]*|aix[5-9]*|osf*|iri
+ freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*)
+ if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
+ # libname.so -> libname.so.M
+- ${echo} ${RM} ${INSTALLDIR}/$LINK1
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK1
+ fi
+ else
+ # libname.so.M -> libname.so.M.N
+- ${echo} ${RM} ${INSTALLDIR}/$LINK2
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK2
+ fi
+
+ # libname.so -> libname.so.M.N
+- ${echo} ${RM} ${INSTALLDIR}/$LINK1
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK1
+ fi
+@@ -178,7 +185,7 @@ freebsd[3-9]*|freebsdelf[3-9]*|freebsdao
+
+ hpux1*)
+ # libname.sl -> libname.M
+- ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1.sl
+ if [ -z "$uninstall" ]; then
+ eval $INSTALL_LINK1
+ fi
diff --git a/SOURCES/readline-6.0-metamode.patch b/SOURCES/readline-6.0-metamode.patch
new file mode 100644
index 0000000..3badc39
--- /dev/null
+++ b/SOURCES/readline-6.0-metamode.patch
@@ -0,0 +1,11 @@
+# See bug bnc#541379
+--- lib/readline/bind.c
++++ lib/readline/bind.c 2009-09-30 11:25:38.087930034 +0200
+@@ -1473,6 +1473,7 @@ static const struct {
+ #if defined (VISIBLE_STATS)
+ { "visible-stats", &rl_visible_stats, 0 },
+ #endif /* VISIBLE_STATS */
++ { "meta-mode", &_rl_enable_meta, 0 },
+ { (char *)NULL, (int *)NULL }
+ };
+
diff --git a/SOURCES/readline-6.0-patches.tar.bz2 b/SOURCES/readline-6.0-patches.tar.bz2
new file mode 100644
index 0000000..f0558bd
--- /dev/null
+++ b/SOURCES/readline-6.0-patches.tar.bz2
Binary files differ
diff --git a/SOURCES/readline-6.0-wrap.patch b/SOURCES/readline-6.0-wrap.patch
new file mode 100644
index 0000000..f26ad5b
--- /dev/null
+++ b/SOURCES/readline-6.0-wrap.patch
@@ -0,0 +1,16 @@
+Index: lib/readline/display.c
+===================================================================
+--- lib/readline/display.c.orig
++++ lib/readline/display.c
+@@ -714,7 +714,10 @@ rl_redisplay ()
+ inv_lbreaks[++newlines] = temp;
+ #if defined (HANDLE_MULTIBYTE)
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0)
+- lpos -= _rl_col_width (local_prompt, n0, num);
++ {
++ if (local_prompt_len > 0)
++ lpos -= _rl_col_width (local_prompt, n0, num);
++ }
+ else
+ #endif
+ lpos -= _rl_screenwidth;
diff --git a/SOURCES/readline-6.0.dif b/SOURCES/readline-6.0.dif
new file mode 100644
index 0000000..3d9abc6
--- /dev/null
+++ b/SOURCES/readline-6.0.dif
@@ -0,0 +1,139 @@
+--- .pkgextract
++++ .pkgextract 2005-12-09 17:09:26.000000000 +0100
+@@ -0,0 +1,5 @@
++tar Oxfj ../readline-6.0-patches.tar.bz2 | patch -p0 -s
++patch -p2 -s --suffix=".zerotty" < ../readline-4.3-input.dif
++patch -p2 -s --suffix=".wrap" < ../readline-6.0-wrap.patch
++patch -p2 -s --suffix=".conf" < ../readline-5.2-conf.patch
++patch -p0 -s --suffix=".destdir" < ../readline-6.0-destdir.patch
+--- Makefile.in
++++ Makefile.in 2009-02-27 17:25:01.076001005 +0100
+@@ -222,10 +222,8 @@ uninstall-headers:
+ maybe-uninstall-headers: uninstall-headers
+
+ install-static: installdirs $(STATIC_LIBS) install-headers install-doc install-examples
+- -$(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
+
+@@ -254,7 +252,7 @@ uninstall-examples: maybe-uninstall-head
+ install-doc: installdirs
+ -( if test -d doc ; then \
+ cd doc && \
+- ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
++ ${MAKE} infodir=$(infodir) DESTDIR=${DESTDIR} install; \
+ fi )
+
+ uninstall-doc:
+--- complete.c
++++ complete.c 2009-02-27 17:25:26.616935393 +0100
+@@ -942,7 +942,7 @@ _rl_find_completion_word (fp, dp)
+ /* We didn't find an unclosed quoted substring upon which to do
+ completion, so use the word break characters to find the
+ substring on which to complete. */
+- while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
++ while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
+ {
+ scan = rl_line_buffer[rl_point];
+
+@@ -1884,7 +1884,7 @@ rl_completion_matches (text, entry_funct
+ match_list[1] = (char *)NULL;
+
+ _rl_interrupt_immediately++;
+- while (string = (*entry_function) (text, matches))
++ while ((string = (*entry_function) (text, matches)))
+ {
+ if (matches + 1 == match_list_size)
+ match_list = (char **)xrealloc
+@@ -1936,7 +1936,7 @@ rl_username_completion_function (text, s
+ }
+
+ #if defined (HAVE_GETPWENT)
+- 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)))
+--- readline.c
++++ readline.c 2005-12-09 17:09:26.000000000 +0100
+@@ -767,7 +767,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;
+
+--- readline.h
++++ readline.h 2005-12-09 17:09:26.000000000 +0100
+@@ -448,7 +448,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));
+--- doc/Makefile.in
++++ doc/Makefile.in 2009-02-27 17:27:31.104001597 +0100
+@@ -98,7 +98,7 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ
+ $(RM) $@
+ -${DVIPDF} $<
+
+-all: info dvi html ps text pdf
++all: info html
+ nodvi: info html text
+
+ xdist: $(DIST_DOCS)
+--- doc/readline.3
++++ doc/readline.3 2006-11-13 17:33:27.000000000 +0100
+@@ -118,6 +118,14 @@ environment variable. If that variable
+ .IR ~/.inputrc .
+ If that file does not exist or cannot be read, the ultimate default is
+ .IR /etc/inputrc .
++If both files
++.I ~/.inputrc
++and
++.I /etc/inputrc
++exist readline will read first
++.I /etc/inputrc
++and then
++.IR ~/.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
+@@ -1286,6 +1294,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
+--- support/shobj-conf
++++ support/shobj-conf 2006-09-22 16:17:48.000000000 +0200
+@@ -112,10 +112,11 @@ sunos5*|solaris2*)
+ linux*-*|gnu*-*|k*bsd*-gnu-*)
+ SHOBJ_CFLAGS=-fPIC
+ SHOBJ_LD='${CC}'
+- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
++ SHOBJ_LDFLAGS='-shared'
+
+- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++ SHLIB_XLDFLAGS='-Wl,-rpath-link,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
++ SHLIB_LIBS=-lncurses
+ ;;
+
+ freebsd2*)
diff --git a/SOURCES/readline-6.0.tar.bz2 b/SOURCES/readline-6.0.tar.bz2
new file mode 100644
index 0000000..23a65c6
--- /dev/null
+++ b/SOURCES/readline-6.0.tar.bz2
Binary files differ
diff --git a/SOURCES/run-tests b/SOURCES/run-tests
new file mode 100644
index 0000000..9a113d8
--- /dev/null
+++ b/SOURCES/run-tests
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests'
+export PATH
+
+# unset BASH_ENV only if it is set
+[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV
+# ditto for SHELLOPTS
+#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS
+
+: ${THIS_SH:=../bash}
+export THIS_SH
+
+${THIS_SH} ./version
+
+rm -f /tmp/xx
+
+echo Any output from any test, unless otherwise noted, indicates a possible anomaly
+
+for x in run-*
+do
+ case $x in
+ $0|run-all|run-minimal|run-gprof|run-jobs|run-ifs-posix) ;;
+ *.orig|*~) ;;
+ *) echo $x ; sh $x ;;
+ esac
+done
+
+exit 0