diff --git a/.cvsignore b/.cvsignore index d3ab883..9919370 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -bash-4.0.tar.gz +bash-4.1-rc1.tar.gz diff --git a/bash-2.05a-interpreter.patch b/bash-2.05a-interpreter.patch index ed5704e..eee07dd 100644 --- a/bash-2.05a-interpreter.patch +++ b/bash-2.05a-interpreter.patch @@ -1,6 +1,50 @@ -diff -up bash-4.0/execute_cmd.c.interpreter bash-4.0/execute_cmd.c ---- bash-4.0/execute_cmd.c.interpreter 2009-01-04 20:32:29.000000000 +0100 -+++ bash-4.0/execute_cmd.c 2009-01-21 14:55:34.000000000 +0100 +diff -up bash-4.1-rc1/config.h.in.interpreter bash-4.1-rc1/config.h.in +--- bash-4.1-rc1/config.h.in.interpreter 2009-12-26 22:44:46.000000000 +0100 ++++ bash-4.1-rc1/config.h.in 2009-12-26 22:44:46.000000000 +0100 +@@ -695,6 +695,9 @@ + /* Define if you have the pathconf function. */ + #undef HAVE_PATHCONF + ++/* Define if you have the pread function. */ ++#undef HAVE_PREAD ++ + /* Define if you have the putenv function. */ + #undef HAVE_PUTENV + +@@ -881,6 +884,9 @@ + /* Define if you have the header file. */ + #undef HAVE_DLFCN_H + ++/* Define if you have the header file. */ ++#undef HAVE_ELF_H ++ + /* Define if you have the header file. */ + #undef HAVE_GRP_H + +diff -up bash-4.1-rc1/configure.in.interpreter bash-4.1-rc1/configure.in +--- bash-4.1-rc1/configure.in.interpreter 2009-12-12 21:43:18.000000000 +0100 ++++ bash-4.1-rc1/configure.in 2009-12-26 22:46:19.000000000 +0100 +@@ -659,7 +659,7 @@ BASH_HEADER_INTTYPES + AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ + memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ + stddef.h stdint.h netdb.h pwd.h grp.h strings.h regex.h \ +- syslog.h) ++ syslog.h elf.h) + AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \ + sys/resource.h sys/param.h sys/socket.h sys/stat.h \ + sys/time.h sys/times.h sys/types.h sys/wait.h) +@@ -723,7 +723,7 @@ dnl checks for system calls + AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \ + getpagesize getpeername getrlimit getrusage gettimeofday \ + kill killpg lstat readlink sbrk select setdtablesize \ +- setitimer tcgetpgrp uname ulimit waitpid) ++ setitimer tcgetpgrp uname ulimit waitpid pread) + AC_REPLACE_FUNCS(rename) + + dnl checks for c library functions +diff -up bash-4.1-rc1/execute_cmd.c.interpreter bash-4.1-rc1/execute_cmd.c +--- bash-4.1-rc1/execute_cmd.c.interpreter 2009-11-29 03:29:34.000000000 +0100 ++++ bash-4.1-rc1/execute_cmd.c 2009-12-26 22:44:46.000000000 +0100 @@ -41,6 +41,10 @@ # include #endif @@ -12,7 +56,7 @@ diff -up bash-4.0/execute_cmd.c.interpreter bash-4.0/execute_cmd.c #include "posixtime.h" #if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE) -@@ -4601,13 +4605,21 @@ shell_execve (command, args, env) +@@ -4805,13 +4809,21 @@ shell_execve (command, args, env) { /* The file has the execute bits set, but the kernel refuses to run it for some reason. See why. */ @@ -35,7 +79,7 @@ diff -up bash-4.0/execute_cmd.c.interpreter bash-4.0/execute_cmd.c interp = getinterp (sample, sample_len, (int *)NULL); ilen = strlen (interp); errno = i; -@@ -4623,6 +4635,136 @@ shell_execve (command, args, env) +@@ -4827,6 +4839,136 @@ shell_execve (command, args, env) return (EX_NOEXEC); } #endif @@ -172,47 +216,3 @@ diff -up bash-4.0/execute_cmd.c.interpreter bash-4.0/execute_cmd.c errno = i; file_error (command); } -diff -up bash-4.0/config.h.in.interpreter bash-4.0/config.h.in ---- bash-4.0/config.h.in.interpreter 2009-01-21 14:55:34.000000000 +0100 -+++ bash-4.0/config.h.in 2009-01-21 14:55:34.000000000 +0100 -@@ -670,6 +670,9 @@ - /* Define if you have the pathconf function. */ - #undef HAVE_PATHCONF - -+/* Define if you have the pread function. */ -+#undef HAVE_PREAD -+ - /* Define if you have the putenv function. */ - #undef HAVE_PUTENV - -@@ -850,6 +853,9 @@ - /* Define if you have the header file. */ - #undef HAVE_DLFCN_H - -+/* Define if you have the header file. */ -+#undef HAVE_ELF_H -+ - /* Define if you have the header file. */ - #undef HAVE_GRP_H - -diff -up bash-4.0/configure.in.interpreter bash-4.0/configure.in ---- bash-4.0/configure.in.interpreter 2009-01-06 17:51:58.000000000 +0100 -+++ bash-4.0/configure.in 2009-01-21 15:04:58.000000000 +0100 -@@ -649,7 +649,7 @@ BASH_HEADER_INTTYPES - - AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ - memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ -- stddef.h stdint.h netdb.h pwd.h grp.h strings.h regex.h) -+ stddef.h stdint.h netdb.h pwd.h grp.h strings.h regex.h elf.h) - AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \ - sys/resource.h sys/param.h sys/socket.h sys/stat.h \ - sys/time.h sys/times.h sys/types.h sys/wait.h) -@@ -713,7 +713,7 @@ dnl checks for system calls - AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \ - getpagesize getpeername getrlimit getrusage gettimeofday \ - kill killpg lstat readlink sbrk select setdtablesize \ -- setitimer tcgetpgrp uname ulimit waitpid) -+ setitimer tcgetpgrp uname ulimit waitpid pread) - AC_REPLACE_FUNCS(rename) - - dnl checks for c library functions diff --git a/bash-4.0-emacs.patch b/bash-4.0-emacs.patch deleted file mode 100644 index c94a57d..0000000 --- a/bash-4.0-emacs.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- bash-4.0/shell.c.orig 2009-10-15 15:57:56.000000000 -0400 -+++ bash-4.0/shell.c 2009-10-15 15:58:28.000000000 -0400 -@@ -572,7 +572,7 @@ - - /* running_under_emacs == 2 for `eterm' */ - running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 5)); -- running_under_emacs += term && STREQN (term, "eterm", 5) && strstr (emacs, "term"); -+ running_under_emacs += term && STREQN (term, "eterm", 5) && (emacs != 0) && strstr (emacs, "term"); - - if (running_under_emacs) - gnu_error_format = 1; diff --git a/bash-cond-rmatch.patch b/bash-cond-rmatch.patch index 0989587..c5fbc24 100644 --- a/bash-cond-rmatch.patch +++ b/bash-cond-rmatch.patch @@ -1,15 +1,13 @@ -diff -up bash-3.2/execute_cmd.c.cond-rmatch bash-3.2/execute_cmd.c ---- bash-3.2/execute_cmd.c.cond-rmatch 2008-06-05 17:21:20.000000000 +0200 -+++ bash-3.2/execute_cmd.c 2008-06-05 17:23:54.000000000 +0200 -@@ -2560,8 +2560,9 @@ execute_cond_node (cond) - arg1 = cond_expand_word (cond->left->op, 0); - if (arg1 == 0) +diff -up bash-4.1-rc1/execute_cmd.c.cond_rmatch bash-4.1-rc1/execute_cmd.c +--- bash-4.1-rc1/execute_cmd.c.cond_rmatch 2009-12-26 22:49:09.000000000 +0100 ++++ bash-4.1-rc1/execute_cmd.c 2009-12-26 22:54:11.000000000 +0100 +@@ -3278,8 +3278,7 @@ execute_cond_node (cond) arg1 = nullstr; + if (ignore) + comsub_ignore_return++; - arg2 = cond_expand_word (cond->right->op, - (rmatch && shell_compatibility_level > 31) ? 2 : (patmatch ? 1 : 0)); -+ + arg2 = cond_expand_word (cond->right->op, patmatch ? 1 : 0); -+ + if (ignore) + comsub_ignore_return--; if (arg2 == 0) - arg2 = nullstr; - diff --git a/bash-requires.patch b/bash-requires.patch index 77542cd..55dc455 100644 --- a/bash-requires.patch +++ b/bash-requires.patch @@ -1,57 +1,94 @@ -diff -up bash-4.0/shell.c.requires bash-4.0/shell.c ---- bash-4.0/shell.c.requires 2009-01-21 15:28:16.000000000 +0100 -+++ bash-4.0/shell.c 2009-01-21 15:28:16.000000000 +0100 -@@ -193,6 +193,9 @@ int have_devfd = 0; - /* The name of the .(shell)rc file. */ - static char *bashrc_file = "~/.bashrc"; - -+/* Non-zero if we are finding the scripts requirements. */ -+int rpm_requires; +diff -up bash-4.1-rc1/builtins.h.requires bash-4.1-rc1/builtins.h +--- bash-4.1-rc1/builtins.h.requires 2009-01-04 20:32:23.000000000 +0100 ++++ bash-4.1-rc1/builtins.h 2009-12-26 22:55:02.000000000 +0100 +@@ -41,6 +41,8 @@ + #define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */ + #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */ + #define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */ ++#define REQUIRES_BUILTIN 0x40 /* This builtin requires other files. */ + - /* Non-zero means to act more like the Bourne shell on startup. */ - static int act_like_sh; -@@ -251,6 +254,7 @@ static const struct { - { "posix", Int, &posixly_correct, (char **)0x0 }, - { "protected", Int, &protected_mode, (char **)0x0 }, - { "rcfile", Charp, (int *)0x0, &bashrc_file }, -+ { "rpm-requires", Int, &rpm_requires, (char **)0x0 }, - #if defined (RESTRICTED_SHELL) - { "restricted", Int, &restricted, (char **)0x0 }, - #endif -@@ -479,6 +483,12 @@ main (argc, argv, env) - if (dump_translatable_strings) - read_but_dont_execute = 1; + #define BASE_INDENT 4 -+ if (rpm_requires) -+ { -+ read_but_dont_execute = 1; -+ initialize_shell_builtins (); -+ } +diff -up bash-4.1-rc1/builtins/mkbuiltins.c.requires bash-4.1-rc1/builtins/mkbuiltins.c +--- bash-4.1-rc1/builtins/mkbuiltins.c.requires 2009-01-04 20:32:23.000000000 +0100 ++++ bash-4.1-rc1/builtins/mkbuiltins.c 2009-12-26 22:55:02.000000000 +0100 +@@ -69,9 +69,15 @@ extern char *strcpy (); + #define whitespace(c) (((c) == ' ') || ((c) == '\t')) + + /* Flag values that builtins can have. */ ++/* These flags are for the C code generator, ++ the C which is produced (./builtin.c) ++ includes the flags definitions found ++ in ../builtins.h */ + #define BUILTIN_FLAG_SPECIAL 0x01 + #define BUILTIN_FLAG_ASSIGNMENT 0x02 + #define BUILTIN_FLAG_POSIX_BUILTIN 0x04 ++#define BUILTIN_FLAG_REQUIRES 0x08 + - if (running_setuid && privileged_mode == 0) - disable_priv_mode (); -diff -up bash-4.0/doc/bashref.texi.requires bash-4.0/doc/bashref.texi ---- bash-4.0/doc/bashref.texi.requires 2009-01-21 15:28:16.000000000 +0100 -+++ bash-4.0/doc/bashref.texi 2009-01-21 15:28:16.000000000 +0100 -@@ -5253,6 +5253,13 @@ standard. @xref{Bash POSIX Mode}, for a - @item --restricted - Make the shell a restricted shell (@pxref{The Restricted Shell}). + #define BASE_INDENT 4 -+@item --rpm-requires -+Produce the list of files that are required for the -+shell script to run. This implies '-n' and is subject -+to the same limitations as compile time error checking checking; -+Backticks, [] tests, and evals are not parsed so some -+dependencies may be missed. +@@ -163,10 +169,18 @@ char *posix_builtins[] = + (char *)NULL + }; + ++/* The builtin commands that cause requirements on other files. */ ++static char *requires_builtins[] = ++{ ++ ".", "command", "exec", "source", "inlib", ++ (char *)NULL ++}; + - @item --verbose - Equivalent to @option{-v}. Print shell input lines as they're read. + /* Forward declarations. */ + static int is_special_builtin (); + static int is_assignment_builtin (); + static int is_posix_builtin (); ++static int is_requires_builtin (); + + #if !defined (HAVE_RENAME) + static int rename (); +@@ -812,6 +826,9 @@ builtin_handler (self, defs, arg) + new->flags |= BUILTIN_FLAG_ASSIGNMENT; + if (is_posix_builtin (name)) + new->flags |= BUILTIN_FLAG_POSIX_BUILTIN; ++ if (is_requires_builtin (name)) ++ new->flags |= BUILTIN_FLAG_REQUIRES; ++ + + array_add ((char *)new, defs->builtins); + building_builtin = 1; +@@ -1229,11 +1246,12 @@ write_builtins (defs, structfile, extern + else + fprintf (structfile, "(sh_builtin_func_t *)0x0, "); -diff -up bash-4.0/doc/bash.1.requires bash-4.0/doc/bash.1 ---- bash-4.0/doc/bash.1.requires 2009-01-21 15:28:16.000000000 +0100 -+++ bash-4.0/doc/bash.1 2009-01-21 15:28:16.000000000 +0100 +- fprintf (structfile, "%s%s%s%s, %s_doc,\n", ++ fprintf (structfile, "%s%s%s%s%s, %s_doc,\n", + "BUILTIN_ENABLED | STATIC_BUILTIN", + (builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "", + (builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "", + (builtin->flags & BUILTIN_FLAG_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "", ++ (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "", + document_name (builtin)); + + fprintf +@@ -1581,6 +1599,13 @@ is_posix_builtin (name) + return (_find_in_table (name, posix_builtins)); + } + ++static int ++is_requires_builtin (name) ++ char *name; ++{ ++ return (_find_in_table (name, requires_builtins)); ++} ++ + #if !defined (HAVE_RENAME) + static int + rename (from, to) +diff -up bash-4.1-rc1/doc/bash.1.requires bash-4.1-rc1/doc/bash.1 +--- bash-4.1-rc1/doc/bash.1.requires 2009-12-26 22:55:02.000000000 +0100 ++++ bash-4.1-rc1/doc/bash.1 2009-12-26 22:55:02.000000000 +0100 @@ -231,6 +231,13 @@ The shell becomes restricted (see .B "RESTRICTED SHELL" below). @@ -66,10 +103,95 @@ diff -up bash-4.0/doc/bash.1.requires bash-4.0/doc/bash.1 .B \-\-verbose Equivalent to \fB\-v\fP. .TP -diff -up bash-4.0/make_cmd.c.requires bash-4.0/make_cmd.c ---- bash-4.0/make_cmd.c.requires 2009-01-04 20:32:38.000000000 +0100 -+++ bash-4.0/make_cmd.c 2009-01-21 15:28:16.000000000 +0100 -@@ -41,11 +41,15 @@ +diff -up bash-4.1-rc1/doc/bashref.texi.requires bash-4.1-rc1/doc/bashref.texi +--- bash-4.1-rc1/doc/bashref.texi.requires 2009-12-26 22:55:02.000000000 +0100 ++++ bash-4.1-rc1/doc/bashref.texi 2009-12-26 22:55:02.000000000 +0100 +@@ -5337,6 +5337,13 @@ standard. @xref{Bash POSIX Mode}, for a + @item --restricted + Make the shell a restricted shell (@pxref{The Restricted Shell}). + ++@item --rpm-requires ++Produce the list of files that are required for the ++shell script to run. This implies '-n' and is subject ++to the same limitations as compile time error checking checking; ++Backticks, [] tests, and evals are not parsed so some ++dependencies may be missed. ++ + @item --verbose + Equivalent to @option{-v}. Print shell input lines as they're read. + +diff -up bash-4.1-rc1/eval.c.requires bash-4.1-rc1/eval.c +--- bash-4.1-rc1/eval.c.requires 2009-01-04 20:32:26.000000000 +0100 ++++ bash-4.1-rc1/eval.c 2009-12-26 22:55:02.000000000 +0100 +@@ -53,6 +53,7 @@ extern int last_command_exit_value, stdi + extern int need_here_doc; + extern int current_command_number, current_command_line_count, line_number; + extern int expand_aliases; ++extern int rpm_requires; + + static void send_pwd_to_eterm __P((void)); + static sighandler alrm_catcher __P((int)); +@@ -136,7 +137,7 @@ reader_loop () + + if (read_command () == 0) + { +- if (interactive_shell == 0 && read_but_dont_execute) ++ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires)) + { + last_command_exit_value = EXECUTION_SUCCESS; + dispose_command (global_command); +diff -up bash-4.1-rc1/execute_cmd.c.requires bash-4.1-rc1/execute_cmd.c +--- bash-4.1-rc1/execute_cmd.c.requires 2009-12-26 22:55:02.000000000 +0100 ++++ bash-4.1-rc1/execute_cmd.c 2009-12-26 22:55:02.000000000 +0100 +@@ -501,6 +501,8 @@ async_redirect_stdin () + + #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0) + ++extern int rpm_requires; ++ + /* Execute the command passed in COMMAND, perhaps doing it asynchrounously. + COMMAND is exactly what read_command () places into GLOBAL_COMMAND. + ASYNCHROUNOUS, if non-zero, says to do this command in the background. +@@ -532,8 +534,13 @@ execute_command_internal (command, async + #else + if (breaking || continuing) + return (last_command_exit_value); +- if (command == 0 || read_but_dont_execute) ++ if (command == 0 || (read_but_dont_execute && !rpm_requires)) + return (EXECUTION_SUCCESS); ++ if (rpm_requires && command->type == cm_function_def) ++ return last_command_exit_value = ++ execute_intern_function (command->value.Function_def->name, ++ command->value.Function_def->command); ++ + #endif + + QUIT; +@@ -5061,7 +5068,7 @@ execute_intern_function (name, function) + + if (check_identifier (name, posixly_correct) == 0) + { +- if (posixly_correct && interactive_shell == 0) ++ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0) + { + last_command_exit_value = EX_BADUSAGE; + jump_to_top_level (ERREXIT); +diff -up bash-4.1-rc1/execute_cmd.h.requires bash-4.1-rc1/execute_cmd.h +--- bash-4.1-rc1/execute_cmd.h.requires 2009-01-16 22:20:15.000000000 +0100 ++++ bash-4.1-rc1/execute_cmd.h 2009-12-26 22:55:02.000000000 +0100 +@@ -22,6 +22,8 @@ + #define _EXECUTE_CMD_H_ + + #include "stdc.h" ++#include "variables.h" ++#include "command.h" + + extern struct fd_bitmap *new_fd_bitmap __P((int)); + extern void dispose_fd_bitmap __P((struct fd_bitmap *)); +diff -up bash-4.1-rc1/make_cmd.c.requires bash-4.1-rc1/make_cmd.c +--- bash-4.1-rc1/make_cmd.c.requires 2009-09-11 23:26:12.000000000 +0200 ++++ bash-4.1-rc1/make_cmd.c 2009-12-26 22:57:46.000000000 +0100 +@@ -42,11 +42,15 @@ #include "flags.h" #include "make_cmd.h" #include "dispose_cmd.h" @@ -85,9 +207,9 @@ diff -up bash-4.0/make_cmd.c.requires bash-4.0/make_cmd.c #if defined (JOB_CONTROL) #include "jobs.h" -@@ -55,6 +59,10 @@ +@@ -56,6 +60,10 @@ - extern int line_number, current_command_line_count; + extern int line_number, current_command_line_count, parser_state; extern int last_command_exit_value; +extern int rpm_requires; + @@ -96,7 +218,7 @@ diff -up bash-4.0/make_cmd.c.requires bash-4.0/make_cmd.c /* Object caching */ sh_obj_cache_t wdcache = {0, 0, 0}; -@@ -810,6 +818,27 @@ make_coproc_command (name, command) +@@ -820,6 +828,27 @@ make_coproc_command (name, command) return (make_command (cm_coproc, (SIMPLE_COM *)temp)); } @@ -124,7 +246,7 @@ diff -up bash-4.0/make_cmd.c.requires bash-4.0/make_cmd.c /* Reverse the word list and redirection list in the simple command has just been parsed. It seems simpler to do this here the one time then by any other method that I can think of. */ -@@ -827,6 +856,27 @@ clean_simple_command (command) +@@ -837,6 +866,27 @@ clean_simple_command (command) REVERSE_LIST (command->value.Simple->redirects, REDIRECT *); } @@ -149,162 +271,40 @@ diff -up bash-4.0/make_cmd.c.requires bash-4.0/make_cmd.c + } + } /*rpm_requires*/ + + parser_state &= ~PST_REDIRLIST; return (command); } +diff -up bash-4.1-rc1/shell.c.requires bash-4.1-rc1/shell.c +--- bash-4.1-rc1/shell.c.requires 2009-12-26 22:55:02.000000000 +0100 ++++ bash-4.1-rc1/shell.c 2009-12-26 22:55:02.000000000 +0100 +@@ -193,6 +193,9 @@ int have_devfd = 0; + /* The name of the .(shell)rc file. */ + static char *bashrc_file = "~/.bashrc"; -diff -up bash-4.0/execute_cmd.c.requires bash-4.0/execute_cmd.c ---- bash-4.0/execute_cmd.c.requires 2009-01-21 15:28:16.000000000 +0100 -+++ bash-4.0/execute_cmd.c 2009-01-21 15:28:16.000000000 +0100 -@@ -497,6 +497,8 @@ async_redirect_stdin () - - #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0) - -+extern int rpm_requires; -+ - /* Execute the command passed in COMMAND, perhaps doing it asynchrounously. - COMMAND is exactly what read_command () places into GLOBAL_COMMAND. - ASYNCHROUNOUS, if non-zero, says to do this command in the background. -@@ -528,8 +530,13 @@ execute_command_internal (command, async - #else - if (breaking || continuing) - return (last_command_exit_value); -- if (command == 0 || read_but_dont_execute) -+ if (command == 0 || (read_but_dont_execute && !rpm_requires)) - return (EXECUTION_SUCCESS); -+ if (rpm_requires && command->type == cm_function_def) -+ return last_command_exit_value = -+ execute_intern_function (command->value.Function_def->name, -+ command->value.Function_def->command); -+ - #endif - - QUIT; -@@ -4859,7 +4866,7 @@ execute_intern_function (name, function) - - if (check_identifier (name, posixly_correct) == 0) - { -- if (posixly_correct && interactive_shell == 0) -+ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0) - { - last_command_exit_value = EX_BADUSAGE; - jump_to_top_level (ERREXIT); -diff -up bash-4.0/execute_cmd.h.requires bash-4.0/execute_cmd.h ---- bash-4.0/execute_cmd.h.requires 2009-01-04 20:32:29.000000000 +0100 -+++ bash-4.0/execute_cmd.h 2009-01-21 15:28:16.000000000 +0100 -@@ -22,6 +22,8 @@ - #define _EXECUTE_CMD_H_ - - #include "stdc.h" -+#include "variables.h" -+#include "command.h" - - extern struct fd_bitmap *new_fd_bitmap __P((int)); - extern void dispose_fd_bitmap __P((struct fd_bitmap *)); -diff -up bash-4.0/builtins.h.requires bash-4.0/builtins.h ---- bash-4.0/builtins.h.requires 2009-01-04 20:32:23.000000000 +0100 -+++ bash-4.0/builtins.h 2009-01-21 16:10:39.000000000 +0100 -@@ -41,6 +41,8 @@ - #define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */ - #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */ - #define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */ -+#define REQUIRES_BUILTIN 0x40 /* This builtin requires other files. */ -+ - - #define BASE_INDENT 4 - -diff -up bash-4.0/eval.c.requires bash-4.0/eval.c ---- bash-4.0/eval.c.requires 2009-01-04 20:32:26.000000000 +0100 -+++ bash-4.0/eval.c 2009-01-21 15:28:16.000000000 +0100 -@@ -53,6 +53,7 @@ extern int last_command_exit_value, stdi - extern int need_here_doc; - extern int current_command_number, current_command_line_count, line_number; - extern int expand_aliases; -+extern int rpm_requires; - - static void send_pwd_to_eterm __P((void)); - static sighandler alrm_catcher __P((int)); -@@ -136,7 +137,7 @@ reader_loop () - - if (read_command () == 0) - { -- if (interactive_shell == 0 && read_but_dont_execute) -+ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires)) - { - last_command_exit_value = EXECUTION_SUCCESS; - dispose_command (global_command); -diff -up bash-4.0/builtins/mkbuiltins.c.requires bash-4.0/builtins/mkbuiltins.c ---- bash-4.0/builtins/mkbuiltins.c.requires 2009-01-04 20:32:23.000000000 +0100 -+++ bash-4.0/builtins/mkbuiltins.c 2009-01-21 16:16:05.000000000 +0100 -@@ -69,9 +69,15 @@ extern char *strcpy (); - #define whitespace(c) (((c) == ' ') || ((c) == '\t')) - - /* Flag values that builtins can have. */ -+/* These flags are for the C code generator, -+ the C which is produced (./builtin.c) -+ includes the flags definitions found -+ in ../builtins.h */ - #define BUILTIN_FLAG_SPECIAL 0x01 - #define BUILTIN_FLAG_ASSIGNMENT 0x02 - #define BUILTIN_FLAG_POSIX_BUILTIN 0x04 -+#define BUILTIN_FLAG_REQUIRES 0x08 ++/* Non-zero if we are finding the scripts requirements. */ ++int rpm_requires; + + /* Non-zero means to act more like the Bourne shell on startup. */ + static int act_like_sh; - #define BASE_INDENT 4 - -@@ -163,10 +169,18 @@ char *posix_builtins[] = - (char *)NULL - }; - -+/* The builtin commands that cause requirements on other files. */ -+static char *requires_builtins[] = -+{ -+ ".", "command", "exec", "source", "inlib", -+ (char *)NULL -+}; -+ - /* Forward declarations. */ - static int is_special_builtin (); - static int is_assignment_builtin (); - static int is_posix_builtin (); -+static int is_requires_builtin (); +@@ -251,6 +254,7 @@ static const struct { + { "posix", Int, &posixly_correct, (char **)0x0 }, + { "protected", Int, &protected_mode, (char **)0x0 }, + { "rcfile", Charp, (int *)0x0, &bashrc_file }, ++ { "rpm-requires", Int, &rpm_requires, (char **)0x0 }, + #if defined (RESTRICTED_SHELL) + { "restricted", Int, &restricted, (char **)0x0 }, + #endif +@@ -485,6 +489,12 @@ main (argc, argv, env) + if (dump_translatable_strings) + read_but_dont_execute = 1; - #if !defined (HAVE_RENAME) - static int rename (); -@@ -812,6 +826,9 @@ builtin_handler (self, defs, arg) - new->flags |= BUILTIN_FLAG_ASSIGNMENT; - if (is_posix_builtin (name)) - new->flags |= BUILTIN_FLAG_POSIX_BUILTIN; -+ if (is_requires_builtin (name)) -+ new->flags |= BUILTIN_FLAG_REQUIRES; ++ if (rpm_requires) ++ { ++ read_but_dont_execute = 1; ++ initialize_shell_builtins (); ++ } + + if (running_setuid && privileged_mode == 0) + disable_priv_mode (); - array_add ((char *)new, defs->builtins); - building_builtin = 1; -@@ -1229,11 +1246,12 @@ write_builtins (defs, structfile, extern - else - fprintf (structfile, "(sh_builtin_func_t *)0x0, "); - -- fprintf (structfile, "%s%s%s%s, %s_doc,\n", -+ fprintf (structfile, "%s%s%s%s%s, %s_doc,\n", - "BUILTIN_ENABLED | STATIC_BUILTIN", - (builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "", - (builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "", - (builtin->flags & BUILTIN_FLAG_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "", -+ (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "", - document_name (builtin)); - - fprintf -@@ -1581,6 +1599,13 @@ is_posix_builtin (name) - return (_find_in_table (name, posix_builtins)); - } - -+static int -+is_requires_builtin (name) -+ char *name; -+{ -+ return (_find_in_table (name, requires_builtins)); -+} -+ - #if !defined (HAVE_RENAME) - static int - rename (from, to) diff --git a/bash.spec b/bash.spec index 720e159..713943b 100644 --- a/bash.spec +++ b/bash.spec @@ -1,15 +1,16 @@ -#%define beta_tag rc1 -%define patchlevel .35 -%define baseversion 4.0 +%define beta_tag rc1 +%define patchleveltag .0 +%define baseversion 4.1 -Version: %{baseversion}%{patchlevel} +Version: %{baseversion}%{?patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 2%{?dist} +Release: 0.1.%{beta_tag}%{?dist} Group: System Environment/Shells -License: GPLv2+ +License: GPLv3+ Url: http://www.gnu.org/software/bash -Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz +#Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz +Source0: ftp://ftp.cwru.edu/pub/bash/%{name}-%{baseversion}-%{beta_tag}.tar.gz # For now there isn't any doc #Source2: ftp://ftp.gnu.org/gnu/bash/bash-doc-%{version}.tar.gz @@ -19,49 +20,12 @@ Source2: dot-bash_profile Source3: dot-bash_logout # Official upstream patches -Patch001: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-001 -Patch002: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-002 -Patch003: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-003 -Patch004: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-004 -Patch005: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-005 -Patch006: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-006 -Patch007: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-007 -Patch008: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-008 -Patch009: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-009 -Patch010: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-010 -Patch011: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-011 -Patch012: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-012 -Patch013: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-013 -Patch014: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-014 -Patch015: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-015 -Patch016: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-016 -Patch017: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-017 -Patch018: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-018 -Patch019: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-019 -Patch020: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-020 -Patch021: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-021 -Patch022: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-022 -Patch023: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-023 -Patch024: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-024 -Patch025: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-025 -Patch026: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-026 -Patch027: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-027 -Patch028: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-028 -Patch029: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-029 -Patch030: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-030 -Patch031: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-031 -Patch032: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-032 -Patch033: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-033 -Patch034: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-034 -Patch035: ftp://ftp.gnu.org/pub/gnu/bash/bash-4.0-patches/bash40-035 - # Other patches Patch101: bash-2.02-security.patch Patch102: bash-2.03-paths.patch Patch103: bash-2.03-profile.patch Patch104: bash-2.05a-interpreter.patch Patch105: bash-2.05b-debuginfo.patch -#Patch106: bash-2.05b-manso.patch Patch107: bash-2.05b-pgrp_sync.patch Patch108: bash-2.05b-readline-oom.patch Patch109: bash-2.05b-xcc.patch @@ -78,9 +42,6 @@ Patch118: bash-tty-tests.patch # 484809, check if interp section is NOBITS Patch123: bash-4.0-nobits.patch -# 530911, bash was segfaulting when TERM=eterm* and EMACS was unset -Patch124: bash-4.0-emacs.patch - Requires(post): ncurses-libs BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -106,52 +67,15 @@ This package contains documentation files for %{name}. %prep #%setup -q -a 2 -%setup -q -n %{name}-%{baseversion} +%setup -q -n %{name}-%{baseversion}-%{beta_tag} # Official upstream patches -%patch001 -p0 -b .001 -%patch002 -p0 -b .002 -%patch003 -p0 -b .003 -%patch004 -p0 -b .004 -%patch005 -p0 -b .005 -%patch006 -p0 -b .006 -%patch007 -p0 -b .007 -%patch008 -p0 -b .008 -%patch009 -p0 -b .009 -%patch010 -p0 -b .010 -%patch011 -p0 -b .011 -%patch012 -p0 -b .012 -%patch013 -p0 -b .013 -%patch014 -p0 -b .014 -%patch015 -p0 -b .015 -%patch016 -p0 -b .016 -%patch017 -p0 -b .017 -%patch018 -p0 -b .018 -%patch019 -p0 -b .019 -%patch020 -p0 -b .020 -%patch021 -p0 -b .021 -%patch022 -p0 -b .022 -%patch023 -p0 -b .023 -%patch024 -p0 -b .024 -%patch025 -p0 -b .025 -%patch026 -p0 -b .026 -%patch027 -p0 -b .027 -%patch028 -p0 -b .028 -%patch029 -p0 -b .029 -%patch030 -p0 -b .030 -%patch031 -p0 -b .031 -%patch032 -p0 -b .032 -%patch033 -p0 -b .033 -#%patch034 -p0 -b .034 -#%patch035 -p0 -b .035 - # Other patches %patch101 -p1 -b .security %patch102 -p1 -b .paths %patch103 -p1 -b .profile %patch104 -p1 -b .interpreter %patch105 -p1 -b .debuginfo -#%patch106 -p1 -b .manso %patch107 -p1 -b .pgrp_sync %patch108 -p1 -b .readline_oom %patch109 -p1 -b .xcc @@ -164,7 +88,6 @@ This package contains documentation files for %{name}. %patch117 -p1 -b .setlocale %patch118 -p1 -b .tty_tests %patch123 -p1 -b .nobits -%patch124 -p1 -b .emacs echo %{version} > _distribution echo %{release} > _patchlevel @@ -332,6 +255,9 @@ fi #%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Sun Dec 27 2009 Roman Rakus - 4.1-0.1.rc1 +- Upstream 4.1.rc1 + * Fri Dec 11 2009 Roman Rakus - 4.0.35-2 - Don't segfault when TERM=eterm* and EMACS is unset (#530911) diff --git a/bash40-001 b/bash40-001 deleted file mode 100644 index 5c6bb34..0000000 --- a/bash40-001 +++ /dev/null @@ -1,162 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-001 - -Bug-Reported-by: Mike Frysinger -Bug-Reference-ID: <200902211821.42188.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00147.html - -Bug-Description: - -Bash has problems parsing certain constructs inside Posix-style $(...) -command substitutions, mostly with backslash-quoting and reserved word -recognition. This is an issue because the contents are parsed at the -time the word containing the command substitution is read. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-03-06 20:32:35.000000000 -0500 -*************** -*** 2928,2931 **** ---- 2932,2936 ---- - #define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ - #define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ -+ #define LEX_INWORD 0x400 - - #define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') -*************** -*** 3180,3184 **** - int *lenp, flags; - { -! int count, ch, peekc, tflags, lex_rwlen, lex_firstind; - int nestlen, ttranslen, start_lineno; - char *ret, *nestret, *ttrans, *heredelim; ---- 3188,3192 ---- - int *lenp, flags; - { -! int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; - int nestlen, ttranslen, start_lineno; - char *ret, *nestret, *ttrans, *heredelim; -*************** -*** 3201,3205 **** - - start_lineno = line_number; -! lex_rwlen = 0; - - heredelim = 0; ---- 3209,3213 ---- - - start_lineno = line_number; -! lex_rwlen = lex_wlen = 0; - - heredelim = 0; -*************** -*** 3268,3271 **** ---- 3276,3319 ---- - } - -+ if (tflags & LEX_PASSNEXT) /* last char was backslash */ -+ { -+ /*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ -+ tflags &= ~LEX_PASSNEXT; -+ if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ -+ { -+ if (retind > 0) -+ retind--; /* swallow previously-added backslash */ -+ continue; -+ } -+ -+ RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); -+ if MBTEST(ch == CTLESC || ch == CTLNUL) -+ ret[retind++] = CTLESC; -+ ret[retind++] = ch; -+ continue; -+ } -+ -+ /* If this is a shell break character, we are not in a word. If not, -+ we either start or continue a word. */ -+ if MBTEST(shellbreak (ch)) -+ { -+ tflags &= ~LEX_INWORD; -+ /*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ -+ } -+ else -+ { -+ if (tflags & LEX_INWORD) -+ { -+ lex_wlen++; -+ /*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ -+ } -+ else -+ { -+ /*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ -+ tflags |= LEX_INWORD; -+ lex_wlen = 0; -+ } -+ } -+ - /* Skip whitespace */ - if MBTEST(shellblank (ch) && lex_rwlen == 0) -*************** -*** 3400,3428 **** - } - else -! ch = peekc; /* fall through and continue XXX - this skips comments if peekc == '#' */ - } -! /* Not exactly right yet, should handle shell metacharacters, too. If -! any changes are made to this test, make analogous changes to subst.c: -! extract_delimited_string(). */ -! else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) - tflags |= LEX_INCOMMENT; - -! if (tflags & LEX_PASSNEXT) /* last char was backslash */ -! { -! tflags &= ~LEX_PASSNEXT; -! if (qc != '\'' && ch == '\n') /* double-quoted \ disappears. */ -! { -! if (retind > 0) -! retind--; /* swallow previously-added backslash */ -! continue; -! } -! -! RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); -! if MBTEST(ch == CTLESC || ch == CTLNUL) -! ret[retind++] = CTLESC; -! ret[retind++] = ch; -! continue; -! } -! else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ - { - RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); ---- 3442,3454 ---- - } - else -! ch = peekc; /* fall through and continue XXX */ - } -! else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) -! { -! /*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ - tflags |= LEX_INCOMMENT; -+ } - -! if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ - { - RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 0 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 1 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-002 b/bash40-002 deleted file mode 100644 index 18bd25e..0000000 --- a/bash40-002 +++ /dev/null @@ -1,43 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-002 - -Bug-Reported-by: phil@Arcturus.universe -Bug-Reference-ID: <20090221143709.13878.qmail@Arcturus.universe> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00142.html - -Bug-Description: - -A line inadvertenly omitted from a submitted patch results in core dumps -when attempting filename completion while using the bash-completion -package. - -Patch: - -*** ../bash-4.0/pcomplete.c 2009-02-01 17:12:31.000000000 -0500 ---- pcomplete.c 2009-02-22 17:08:25.000000000 -0500 -*************** -*** 1033,1036 **** ---- 1033,1037 ---- - - pps = &ps; -+ save_parser_state (pps); - begin_unwind_frame ("gen-shell-function-matches"); - add_unwind_protect (restore_parser_state, (char *)pps); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 1 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 2 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-003 b/bash40-003 deleted file mode 100644 index cc941d5..0000000 --- a/bash40-003 +++ /dev/null @@ -1,70 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-003 - -Bug-Reported-by: Bernd Eggink -Bug-Reference-ID: <49A323F5.60503@sudrala.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00177.html - -Bug-Description: - -Under certain circumstances, constructs containing command substitutions -prevent PS1 from being re-evaluated and updated before being displayed. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-25 15:58:25.000000000 -0500 -*************** -*** 1616,1623 **** - int *ret; - -! ret = (int *)xmalloc (3 * sizeof (int)); - ret[0] = last_read_token; - ret[1] = token_before_that; - ret[2] = two_tokens_ago; - return ret; - } ---- 1616,1624 ---- - int *ret; - -! ret = (int *)xmalloc (4 * sizeof (int)); - ret[0] = last_read_token; - ret[1] = token_before_that; - ret[2] = two_tokens_ago; -+ ret[3] = current_token; - return ret; - } -*************** -*** 1632,1635 **** ---- 1633,1637 ---- - token_before_that = ts[1]; - two_tokens_ago = ts[2]; -+ current_token = ts[3]; - } - -*************** -*** 2669,2672 **** ---- 2671,2675 ---- - word_desc_to_read = (WORD_DESC *)NULL; - -+ current_token = '\n'; /* XXX */ - last_read_token = '\n'; - token_to_read = '\n'; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 2 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 3 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-004 b/bash40-004 deleted file mode 100644 index 6ab6c4e..0000000 --- a/bash40-004 +++ /dev/null @@ -1,47 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-004 - -Bug-Reported-by: Mike Frysinger -Bug-Reference-ID: <200902231720.30519.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00176.html - -Bug-Description: - -In some cases, enabling the `checkjobs' shell option will cause the shell -to core dump when executing the `exit' builtin. - -Patch: - -*** ../bash-4.0/builtins/exit.def 2009-01-04 14:32:22.000000000 -0500 ---- builtins/exit.def 2009-02-23 22:56:58.000000000 -0500 -*************** -*** 114,118 **** - if (jobs[i] && STOPPED (i)) - stopmsg = JSTOPPED; -! else if (check_jobs_at_exit && stopmsg == 0 && RUNNING (i)) - stopmsg = JRUNNING; - ---- 114,118 ---- - if (jobs[i] && STOPPED (i)) - stopmsg = JSTOPPED; -! else if (check_jobs_at_exit && stopmsg == 0 && jobs[i] && RUNNING (i)) - stopmsg = JRUNNING; - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 3 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 4 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-005 b/bash40-005 deleted file mode 100644 index ccfde66..0000000 --- a/bash40-005 +++ /dev/null @@ -1,63 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-005 - -Bug-Reported-by: Pierre Gaston -Bug-Reference-ID: -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00206.html - -Bug-Description: - -The `declare' builtin dumped core when attempting to assign associative -array indices containing some special characters, even when they were -quoted before being expanded. - -Patch: - -*** ../bash-4.0/builtins/declare.def 2009-01-04 14:32:22.000000000 -0500 ---- builtins/declare.def 2009-02-26 11:40:16.000000000 -0500 -*************** -*** 296,299 **** ---- 296,306 ---- - if (t = strchr (name, '[')) /* ] */ - { -+ /* If offset != 0 we have already validated any array reference */ -+ if (offset == 0 && valid_array_reference (name) == 0) -+ { -+ sh_invalidid (name); -+ assign_error++; -+ NEXT_VARIABLE (); -+ } - subscript_start = t; - *t = '\0'; -*************** -*** 485,489 **** - /* declare -a name[[n]] or declare name[n] makes name an indexed - array variable. */ -! else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0) - var = convert_var_to_array (var); - #endif /* ARRAY_VARS */ ---- 492,496 ---- - /* declare -a name[[n]] or declare name[n] makes name an indexed - array variable. */ -! else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0 && assoc_p (var) == 0) - var = convert_var_to_array (var); - #endif /* ARRAY_VARS */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 4 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 5 - - #endif /* _PATCHLEVEL_H_ */ - diff --git a/bash40-006 b/bash40-006 deleted file mode 100644 index 3d044c7..0000000 --- a/bash40-006 +++ /dev/null @@ -1,43 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-006 - -Bug-Reported-by: Evgeniy Zhemchugov -Bug-Reference-ID: -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00202.html - -Bug-Description: - -Bash did not parse pipelines using the |& construct correctly if the -pipeline elements were not simple commands. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-25 17:25:56.000000000 -0500 -*************** -*** 4478,4481 **** ---- 4478,4482 ---- - case AND_AND: - case BANG: -+ case BAR_AND: - case DO: - case DONE: -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 5 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 6 - - #endif /* _PATCHLEVEL_H_ */ - diff --git a/bash40-007 b/bash40-007 deleted file mode 100644 index 29071e1..0000000 --- a/bash40-007 +++ /dev/null @@ -1,263 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-007 - -Bug-Reported-by: AnMaster -Bug-Reference-ID: <49A41C18.80807@tele2.se> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00188.html - -Bug-Description: - -Bash had a number of problems parsing associative array subscripts containing -special characters. The subscripts are supposed to be read as if they are -enclosed between double quotes. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-25 17:25:56.000000000 -0500 -*************** -*** 2919,2922 **** ---- 2919,2923 ---- - #define P_COMMAND 0x08 /* parsing a command, so look for comments */ - #define P_BACKQUOTE 0x10 /* parsing a backquoted command substitution */ -+ #define P_ARRAYSUB 0x20 /* parsing a [...] array subscript for assignment */ - - /* Lexical state while parsing a grouping construct or $(...). */ -*************** -*** 3134,3137 **** ---- 3134,3139 ---- - FREE (nestret); - } -+ else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ -+ goto parse_dollar_word; - } - /* Parse an old-style command substitution within double quotes as a -*************** -*** 3150,3153 **** ---- 3150,3154 ---- - /* check for $(), $[], or ${} inside quoted string. */ - { -+ parse_dollar_word: - if (open == ch) /* undo previous increment */ - count--; -*************** -*** 4277,4281 **** - (token_index == 0 && (parser_state&PST_COMPASSIGN)))) - { -! ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); - if (ttok == &matched_pair_error) - return -1; /* Bail immediately. */ ---- 4277,4281 ---- - (token_index == 0 && (parser_state&PST_COMPASSIGN)))) - { -! ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); - if (ttok == &matched_pair_error) - return -1; /* Bail immediately. */ -*** ../bash-4.0/arrayfunc.c 2009-01-04 14:32:21.000000000 -0500 ---- arrayfunc.c 2009-02-25 07:58:54.000000000 -0500 -*************** -*** 605,666 **** - } - -! /* This function assumes s[i] == '['; returns with s[ret] == ']' if -! an array subscript is correctly parsed. */ -! int -! skipsubscript (s, i) -! const char *s; -! int i; -! { -! int count, c; -! #if defined (HANDLE_MULTIBYTE) -! mbstate_t state, state_bak; -! size_t slength, mblength; -! #endif -! -! #if defined (HANDLE_MULTIBYTE) -! memset (&state, '\0', sizeof (mbstate_t)); -! slength = strlen (s + i); -! #endif -! -! count = 1; -! while (count) -! { -! /* Advance one (possibly multibyte) character in S starting at I. */ -! #if defined (HANDLE_MULTIBYTE) -! if (MB_CUR_MAX > 1) -! { -! state_bak = state; -! mblength = mbrlen (s + i, slength, &state); -! -! if (MB_INVALIDCH (mblength)) -! { -! state = state_bak; -! i++; -! slength--; -! } -! else if (MB_NULLWCH (mblength)) -! return i; -! else -! { -! i += mblength; -! slength -= mblength; -! } -! } -! else -! #endif -! ++i; -! -! c = s[i]; -! -! if (c == 0) -! break; -! else if (c == '[') -! count++; -! else if (c == ']') -! count--; -! } -! -! return i; -! } - - /* This function is called with SUB pointing to just after the beginning ---- 605,609 ---- - } - -! /* skipsubscript moved to subst.c to use private functions. 2009/02/24. */ - - /* This function is called with SUB pointing to just after the beginning -*** ../bash-4.0/subst.c 2009-01-28 14:34:12.000000000 -0500 ---- subst.c 2009-02-25 09:18:33.000000000 -0500 -*************** -*** 223,226 **** ---- 223,227 ---- - static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); - static char *extract_dollar_brace_string __P((char *, int *, int, int)); -+ static int skip_matched_pair __P((const char *, int, int, int, int)); - - static char *pos_params __P((char *, int, int, int)); -*************** -*** 1375,1378 **** ---- 1376,1480 ---- - #define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) - -+ /* This function assumes s[i] == open; returns with s[ret] == close; used to -+ parse array subscripts. FLAGS currently unused. */ -+ static int -+ skip_matched_pair (string, start, open, close, flags) -+ const char *string; -+ int start, open, close, flags; -+ { -+ int i, pass_next, backq, si, c, count; -+ size_t slen; -+ char *temp, *ss; -+ DECLARE_MBSTATE; -+ -+ slen = strlen (string + start) + start; -+ no_longjmp_on_fatal_error = 1; -+ -+ i = start + 1; /* skip over leading bracket */ -+ count = 1; -+ pass_next = backq = 0; -+ ss = (char *)string; -+ while (c = string[i]) -+ { -+ if (pass_next) -+ { -+ pass_next = 0; -+ if (c == 0) -+ CQ_RETURN(i); -+ ADVANCE_CHAR (string, slen, i); -+ continue; -+ } -+ else if (c == '\\') -+ { -+ pass_next = 1; -+ i++; -+ continue; -+ } -+ else if (backq) -+ { -+ if (c == '`') -+ backq = 0; -+ ADVANCE_CHAR (string, slen, i); -+ continue; -+ } -+ else if (c == '`') -+ { -+ backq = 1; -+ i++; -+ continue; -+ } -+ else if (c == open) -+ { -+ count++; -+ i++; -+ continue; -+ } -+ else if (c == close) -+ { -+ count--; -+ if (count == 0) -+ break; -+ i++; -+ continue; -+ } -+ else if (c == '\'' || c == '"') -+ { -+ i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) -+ : skip_double_quoted (ss, slen, ++i); -+ /* no increment, the skip functions increment past the closing quote. */ -+ } -+ else if (c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) -+ { -+ si = i + 2; -+ if (string[si] == '\0') -+ CQ_RETURN(si); -+ -+ if (string[i+1] == LPAREN) -+ temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ -+ else -+ temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); -+ i = si; -+ if (string[i] == '\0') /* don't increment i past EOS in loop */ -+ break; -+ i++; -+ continue; -+ } -+ else -+ ADVANCE_CHAR (string, slen, i); -+ } -+ -+ CQ_RETURN(i); -+ } -+ -+ #if defined (ARRAY_VARS) -+ int -+ skipsubscript (string, start) -+ const char *string; -+ int start; -+ { -+ return (skip_matched_pair (string, start, '[', ']', 0)); -+ } -+ #endif -+ - /* Skip characters in STRING until we find a character in DELIMS, and return - the index of that character. START is the index into string at which we -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 6 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 7 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-008 b/bash40-008 deleted file mode 100644 index 7a2576a..0000000 --- a/bash40-008 +++ /dev/null @@ -1,49 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-008 - -Bug-Reported-by: Mike Frysinger -Bug-Reference-ID: <200902261030.54062.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00230.html - -Bug-Description: - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-26 17:22:15.000000000 -0500 -*************** -*** 3443,3448 **** - else - shell_ungetc (peekc); -! tflags |= LEX_HEREDELIM; -! lex_firstind = -1; - continue; - } ---- 3443,3451 ---- - else - shell_ungetc (peekc); -! if (peekc != '<') -! { -! tflags |= LEX_HEREDELIM; -! lex_firstind = -1; -! } - continue; - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 7 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 8 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-009 b/bash40-009 deleted file mode 100644 index f583919..0000000 --- a/bash40-009 +++ /dev/null @@ -1,61 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-009 - -Bug-Reported-by: "Chris F.A. Johnson" -Bug-Reference-ID: <4d6b7$49a88cec$cef88ba3$16813@TEKSAVVY.COM> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00255.html - -Bug-Description: - -When the read builtin returned due to a timeout supplied with the -t option, -it did not restore any modified terminal attribtues. - -Patch: - -*** ../bash-4.0/builtins/read.def 2009-01-15 23:11:21.000000000 -0500 ---- builtins/read.def 2009-03-02 10:15:39.000000000 -0500 -*************** -*** 370,381 **** - if (code) - { -! #if 0 - run_unwind_frame ("read_builtin"); -- return (EXECUTION_FAILURE); -- #else - input_string[i] = '\0'; /* make sure it's terminated */ -! retval = 128+SIGALRM;; - goto assign_vars; -- #endif - } - old_alrm = set_signal_handler (SIGALRM, sigalrm); ---- 370,381 ---- - if (code) - { -! /* Tricky. The top of the unwind-protect stack is the free of -! input_string. We want to run all the rest and use input_string, -! so we have to remove it from the stack. */ -! remove_unwind_protect (); - run_unwind_frame ("read_builtin"); - input_string[i] = '\0'; /* make sure it's terminated */ -! retval = 128+SIGALRM; - goto assign_vars; - } - old_alrm = set_signal_handler (SIGALRM, sigalrm); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 8 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 9 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-010 b/bash40-010 deleted file mode 100644 index 3229c57..0000000 --- a/bash40-010 +++ /dev/null @@ -1,63 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-010 - -Bug-Reported-by: Mike Frysinger -Bug-Reference-ID: <200903030122.56206.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00023.html - -Bug-Description: - -Bash has problems parsing comments in case statements when they appear in -$(...) subshells. - -Patch: - -*** ../bash-4.0/parse.y 2009-03-07 15:18:35.000000000 -0500 ---- parse.y 2009-03-07 14:16:32.000000000 -0500 -*************** -*** 3413,3419 **** - tflags &= ~LEX_RESWDOK; - } -! else if (shellbreak (ch) == 0) - { -! tflags &= ~LEX_RESWDOK; - /*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ - } ---- 3415,3433 ---- - tflags &= ~LEX_RESWDOK; - } -! else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) -! ; /* don't modify LEX_RESWDOK if we're starting a comment */ -! else if MBTEST((tflags & LEX_INCASE) && ch != '\n') -! /* If we can read a reserved word and we're in case, we're at the -! point where we can read a new pattern list or an esac. We -! handle the esac case above. If we read a newline, we want to -! leave LEX_RESWDOK alone. If we read anything else, we want to -! turn off LEX_RESWDOK, since we're going to read a pattern list. */ - { -! tflags &= ~LEX_RESWDOK; -! /*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ -! } -! else if MBTEST(shellbreak (ch) == 0) -! { -! tflags &= ~LEX_RESWDOK; - /*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 9 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 10 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-011 b/bash40-011 deleted file mode 100644 index 61d1d3a..0000000 --- a/bash40-011 +++ /dev/null @@ -1,49 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-011 - -Bug-Reported-by: Matt Zyzik n -Bug-Reference-ID: <20090312015018.C00741383ED@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00092.html - -Bug-Description: - -When using the new |& operator following a simple command with a redirection, -the redirection of stderr through the pipe was not performed under certain -circumstances. - -Patch: - -*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.000000000 -0400 ---- parse.y 2009-03-12 21:36:23.000000000 -0400 -*************** -*** 1123,1127 **** - REDIRECT *r; - -! tc = $1; - rd.dest = 1; - r = make_redirection (2, r_duplicating_output, rd); ---- 1123,1127 ---- - REDIRECT *r; - -! tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1; - rd.dest = 1; - r = make_redirection (2, r_duplicating_output, rd); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 10 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 11 - - #endif /* _PATCHLEVEL_H_ */ - diff --git a/bash40-012 b/bash40-012 deleted file mode 100644 index 014eae6..0000000 --- a/bash40-012 +++ /dev/null @@ -1,47 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-012 - -Bug-Reported-by: "Clark J. Wang" -Bug-Reference-ID: -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00129.html - -Bug-Description: - -A case statement using the ;& pattern terminator followed immediately by -"esac" caused a core dump due to a null pointer dereference. - -Patch: - -*** ../bash-4.0-patched/execute_cmd.c 2009-02-13 16:41:41.000000000 -0500 ---- execute_cmd.c 2009-03-14 13:23:00.000000000 -0400 -*************** -*** 2931,2935 **** - } - while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); -! if ((clauses->flags & CASEPAT_TESTNEXT) == 0) - EXIT_CASE (); - else ---- 2931,2935 ---- - } - while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); -! if (clauses == 0 || (clauses->flags & CASEPAT_TESTNEXT) == 0) - EXIT_CASE (); - else -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 11 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 12 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-013 b/bash40-013 deleted file mode 100644 index df1fc49..0000000 --- a/bash40-013 +++ /dev/null @@ -1,153 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-013 - -Bug-Reported-by: jidanni@jidanni.org -Bug-Reference-ID: -Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165 - -Bug-Description: - -Though references to $@ when there are no positional parameters will now -cause the shell to exit if the `errexit' option has been enabled, constructs -such as ${@:-foo} should not cause an exit. - -Patch: - -*** ../bash-4.0-patched/subst.c 2009-03-08 21:24:39.000000000 -0400 ---- subst.c 2009-03-14 19:04:10.000000000 -0400 -*************** -*** 86,89 **** ---- 86,90 ---- - /* Flags for the `pflags' argument to param_expand() */ - #define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ -+ #define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ - - /* These defs make it easier to use the editor. */ -*************** -*** 264,268 **** - static int chk_arithsub __P((const char *, int)); - -! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int)); - static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); - static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); ---- 265,269 ---- - static int chk_arithsub __P((const char *, int)); - -! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int)); - static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); - static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); -*************** -*** 5196,5202 **** - NAME was found inside of a double-quoted expression. */ - static WORD_DESC * -! parameter_brace_expand_word (name, var_is_special, quoted) - char *name; -! int var_is_special, quoted; - { - WORD_DESC *ret; ---- 5197,5203 ---- - NAME was found inside of a double-quoted expression. */ - static WORD_DESC * -! parameter_brace_expand_word (name, var_is_special, quoted, pflags) - char *name; -! int var_is_special, quoted, pflags; - { - WORD_DESC *ret; -*************** -*** 5230,5234 **** - - ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, -! (int *)NULL, (int *)NULL, 0); - free (tt); - } ---- 5231,5235 ---- - - ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, -! (int *)NULL, (int *)NULL, pflags); - free (tt); - } -*************** -*** 5291,5295 **** - WORD_DESC *w; - -! w = parameter_brace_expand_word (name, var_is_special, quoted); - t = w->word; - /* Have to dequote here if necessary */ ---- 5292,5296 ---- - WORD_DESC *w; - -! w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND); - t = w->word; - /* Have to dequote here if necessary */ -*************** -*** 5308,5312 **** - return (WORD_DESC *)NULL; - -! w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted); - free (t); - ---- 5309,5313 ---- - return (WORD_DESC *)NULL; - -! w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0); - free (t); - -*************** -*** 6659,6663 **** - tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); - else -! tdesc = parameter_brace_expand_word (name, var_is_special, quoted); - - if (tdesc) ---- 6660,6664 ---- - tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); - else -! tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND); - - if (tdesc) -*************** -*** 6990,6994 **** - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error) - { - uerror[0] = '$'; ---- 6991,6995 ---- - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { - uerror[0] = '$'; -*************** -*** 7052,7056 **** - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error) - { - uerror[0] = '$'; ---- 7053,7057 ---- - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { - uerror[0] = '$'; - - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 12 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 13 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-014 b/bash40-014 deleted file mode 100644 index eeba336..0000000 --- a/bash40-014 +++ /dev/null @@ -1,113 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-014 - -Bug-Reported-by: smallnow@gmail.com -Bug-Reference-ID: <49C460FE.40307@gmail.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00166.html - -Bug-Description: - -When the fc builtin is run in a command substitution from a shell with history -enabled, it does not correctly calculate the command on which to operate. - -Patch: - -*** ../bash-4.0-patched/builtins/fc.def 2009-01-04 14:32:22.000000000 -0500 ---- builtins/fc.def 2009-03-21 14:03:43.000000000 -0400 -*************** -*** 89,92 **** ---- 89,93 ---- - extern int literal_history; - extern int posixly_correct; -+ extern int subshell_environment, interactive_shell; - - extern int unlink __P((const char *)); -*************** -*** 173,177 **** - register char *sep; - int numbering, reverse, listing, execute; -! int histbeg, histend, last_hist, retval, opt; - FILE *stream; - REPL *rlist, *rl; ---- 174,178 ---- - register char *sep; - int numbering, reverse, listing, execute; -! int histbeg, histend, last_hist, retval, opt, rh; - FILE *stream; - REPL *rlist, *rl; -*************** -*** 276,279 **** ---- 277,282 ---- - fprintf (stderr, "%s\n", command); - fc_replhist (command); /* replace `fc -s' with command */ -+ /* Posix says that the re-executed commands should be entered into the -+ history. */ - return (parse_and_execute (command, "fc", SEVAL_NOHIST)); - } -*************** -*** 294,298 **** - so we check hist_last_line_added. */ - -! last_hist = i - remember_on_history - hist_last_line_added; - - if (list) ---- 297,306 ---- - so we check hist_last_line_added. */ - -! /* Even though command substitution through parse_and_execute turns off -! remember_on_history, command substitution in a shell when set -o history -! has been enabled (interactive or not) should use it in the last_hist -! calculation as if it were on. */ -! rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); -! last_hist = i - rh - hist_last_line_added; - - if (list) -*************** -*** 457,461 **** - HIST_ENTRY **hlist; - { -! int sign, n, clen; - register int i, j; - register char *s; ---- 465,469 ---- - HIST_ENTRY **hlist; - { -! int sign, n, clen, rh; - register int i, j; - register char *s; -*************** -*** 473,477 **** - so we check hist_last_line_added. This needs to agree with the - calculation of last_hist in fc_builtin above. */ -! i -= remember_on_history + hist_last_line_added; - - /* No specification defaults to most recent command. */ ---- 481,490 ---- - so we check hist_last_line_added. This needs to agree with the - calculation of last_hist in fc_builtin above. */ -! /* Even though command substitution through parse_and_execute turns off -! remember_on_history, command substitution in a shell when set -o history -! has been enabled (interactive or not) should use it in the last_hist -! calculation as if it were on. */ -! rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); -! i -= rh + hist_last_line_added; - - /* No specification defaults to most recent command. */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 13 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 14 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-015 b/bash40-015 deleted file mode 100644 index c3e8d33..0000000 --- a/bash40-015 +++ /dev/null @@ -1,84 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-015 - -Bug-Reported-by: Lubomir Rintel -Bug-Reference-ID: <1237654931.32737.13.camel@localhost.localdomain> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00174.html - -Bug-Description: - -Deferring handling of signals which should cause the shell to terminate until -it is "safe" to run the handler functions does not work for some terminating -signals. - -Patch: - -*** ../bash-4.0-patched/sig.c 2009-01-04 14:32:41.000000000 -0500 ---- sig.c 2009-03-22 14:47:56.000000000 -0400 -*************** -*** 449,452 **** ---- 449,494 ---- - int sig; - { -+ /* If we get called twice with the same signal before handling it, -+ terminate right away. */ -+ if ( -+ #ifdef SIGHUP -+ sig != SIGHUP && -+ #endif -+ #ifdef SIGINT -+ sig != SIGINT && -+ #endif -+ #ifdef SIGDANGER -+ sig != SIGDANGER && -+ #endif -+ #ifdef SIGPIPE -+ sig != SIGPIPE && -+ #endif -+ #ifdef SIGALRM -+ sig != SIGALRM && -+ #endif -+ #ifdef SIGTERM -+ sig != SIGTERM && -+ #endif -+ #ifdef SIGXCPU -+ sig != SIGXCPU && -+ #endif -+ #ifdef SIGXFSZ -+ sig != SIGXFSZ && -+ #endif -+ #ifdef SIGVTALRM -+ sig != SIGVTALRM && -+ #endif -+ #ifdef SIGLOST -+ sig != SIGLOST && -+ #endif -+ #ifdef SIGUSR1 -+ sig != SIGUSR1 && -+ #endif -+ #ifdef SIGUSR2 -+ sig != SIGUSR2 && -+ #endif -+ sig == terminating_signal) -+ terminate_immediately = 1; -+ - terminating_signal = sig; - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 14 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 15 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-016 b/bash40-016 deleted file mode 100644 index ace2e1e..0000000 --- a/bash40-016 +++ /dev/null @@ -1,104 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-016 - -Bug-Reported-by: Brian J. Murrell" -Bug-Reference-ID: <1237564627.7666.12.camel@pc.interlinx.bc.ca> -Bug-Reference-URL:http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00160.html - -Bug-Description: - -There are several problems with the handling of $LINENO in an ERR trap. - -Patch: - -*** ../bash-4.0-patched/trap.c 2009-01-16 17:07:53.000000000 -0500 ---- trap.c 2009-03-20 21:37:00.000000000 -0400 -*************** -*** 756,760 **** - - flags = SEVAL_NONINT|SEVAL_NOHIST; -! if (sig != DEBUG_TRAP && sig != RETURN_TRAP) - flags |= SEVAL_RESETLINE; - if (function_code == 0) ---- 756,760 ---- - - flags = SEVAL_NONINT|SEVAL_NOHIST; -! if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP) - flags |= SEVAL_RESETLINE; - if (function_code == 0) -*** ../bash-4.0-patched/execute_cmd.c 2009-02-13 16:41:41.000000000 -0500 ---- execute_cmd.c 2009-03-21 14:16:11.000000000 -0400 -*************** -*** 569,572 **** ---- 569,573 ---- - /* Fork a subshell, turn off the subshell bit, turn off job - control and call execute_command () on the command again. */ -+ line_number_for_err_trap = line_number; - paren_pid = make_child (savestring (make_command_string (command)), - asynchronous); -*************** -*** 611,615 **** ---- 612,619 ---- - { - last_command_exit_value = exec_result; -+ save_line_number = line_number; -+ line_number = line_number_for_err_trap; - run_error_trap (); -+ line_number = save_line_number; - } - -*************** -*** 767,771 **** ---- 771,777 ---- - { - last_command_exit_value = exec_result; -+ line_number = line_number_for_err_trap; - run_error_trap (); -+ line_number = save_line_number; - } - -*************** -*** 2106,2109 **** ---- 2112,2116 ---- - COMMAND *tc, *second; - int ignore_return, exec_result, was_error_trap, invert; -+ volatile int save_line_number; - - ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; -*************** -*** 2175,2178 **** ---- 2182,2186 ---- - ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; - -+ line_number_for_err_trap = line_number; - exec_result = execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close); - -*************** -*** 2180,2184 **** ---- 2188,2195 ---- - { - last_command_exit_value = exec_result; -+ save_line_number = line_number; -+ line_number = line_number_for_err_trap; - run_error_trap (); -+ line_number = save_line_number; - } - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 15 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 16 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-017 b/bash40-017 deleted file mode 100644 index ff42d77..0000000 --- a/bash40-017 +++ /dev/null @@ -1,47 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-017 - -Bug-Reported-by: Lubomir Rintel -Bug-Reference-ID: <1237654931.32737.13.camel@localhost.localdomain> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00174.html - -Bug-Description: - -Adding a null line to a here-document (e.g., by hitting EOF) causes the -shell to dump core attempting to dereference the NULL pointer. - -Patch: - -*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.000000000 -0400 ---- parse.y 2009-03-21 14:38:42.000000000 -0400 -*************** -*** 1880,1884 **** - ret = read_a_line (remove_quoted_newline); - #if defined (HISTORY) -! if (remember_on_history && (parser_state & PST_HEREDOC)) - { - /* To make adding the the here-document body right, we need to rely ---- 1880,1884 ---- - ret = read_a_line (remove_quoted_newline); - #if defined (HISTORY) -! if (ret && remember_on_history && (parser_state & PST_HEREDOC)) - { - /* To make adding the the here-document body right, we need to rely -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 16 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 17 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-018 b/bash40-018 deleted file mode 100644 index 35f33e5..0000000 --- a/bash40-018 +++ /dev/null @@ -1,78 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-018 - -Bug-Reported-by: Dan Price -Bug-Reference-ID: <20090324171502.GA20582@eng.sun.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00184.html - -Bug-Description: - -A missing include file results in an empty function definition and a no-op -when checking whether or not the window size has changed. - -Patch: - -*** ../bash-4.0-patched/lib/sh/winsize.c 2008-08-12 13:53:51.000000000 -0400 ---- lib/sh/winsize.c 2009-04-06 10:44:20.000000000 -0400 -*************** -*** 31,44 **** - #include - -! #if !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) -! /* For struct winsize on SCO */ -! /* sys/ptem.h has winsize but needs mblk_t from sys/stream.h */ -! # if defined (HAVE_SYS_PTEM_H) && defined (TIOCGWINSZ) && defined (SIGWINCH) -! # if defined (HAVE_SYS_STREAM_H) -! # include -! # endif - # include -! # endif /* HAVE_SYS_PTEM_H && TIOCGWINSZ && SIGWINCH */ -! #endif /* !STRUCT_WINSIZE_IN_SYS_IOCTL */ - - #include ---- 31,57 ---- - #include - -! /* Try to find the definitions of `struct winsize' and TIOGCWINSZ */ -! -! #if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ) -! # include -! #endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */ -! -! #if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) -! # include -! #endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ -! -! /* Not in either of the standard places, look around. */ -! #if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) -! # if defined (HAVE_SYS_STREAM_H) -! # include -! # endif /* HAVE_SYS_STREAM_H */ -! # if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */ - # include -! # define _IO_PTEM_H /* work around SVR4.2 1.1.4 bug */ -! # endif /* HAVE_SYS_PTEM_H */ -! # if defined (HAVE_SYS_PTE_H) /* ??? */ -! # include -! # endif /* HAVE_SYS_PTE_H */ -! #endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ - - #include -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 17 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 18 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-019 b/bash40-019 deleted file mode 100644 index 30efd68..0000000 --- a/bash40-019 +++ /dev/null @@ -1,125 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-019 - -Bug-Reported-by: Oleksiy Melnyk -Bug-Reference-ID: <20090224142233.D2FEFC004@floyd.upc.ua> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00200.html - -Bug-Description: - -Using an external command as part of the DEBUG trap when job control is -enabled causes pipelines to misbehave. The problem has to do with process -groups assigned to the pipeline and terminal. - -Patch: - -*** ../bash-4.0-patched/jobs.c 2009-01-29 17:09:49.000000000 -0500 ---- jobs.c 2009-04-17 21:08:20.000000000 -0400 -*************** -*** 443,447 **** - the_pipeline = saved_pipeline; - already_making_children = saved_already_making_children; -! if (discard) - discard_pipeline (old_pipeline); - } ---- 443,447 ---- - the_pipeline = saved_pipeline; - already_making_children = saved_already_making_children; -! if (discard && old_pipeline) - discard_pipeline (old_pipeline); - } -*************** -*** 4203,4205 **** ---- 4204,4225 ---- - } - -+ void -+ save_pgrp_pipe (p, clear) -+ int *p; -+ int clear; -+ { -+ p[0] = pgrp_pipe[0]; -+ p[1] = pgrp_pipe[1]; -+ if (clear) -+ pgrp_pipe[0] = pgrp_pipe[1] = -1; -+ } -+ -+ void -+ restore_pgrp_pipe (p) -+ int *p; -+ { -+ pgrp_pipe[0] = p[0]; -+ pgrp_pipe[1] = p[1]; -+ } -+ - #endif /* PGRP_PIPE */ -*** ../bash-4.0-patched/jobs.h 2009-01-04 14:32:29.000000000 -0500 ---- jobs.h 2009-04-17 15:07:51.000000000 -0400 -*************** -*** 236,239 **** ---- 236,241 ---- - - extern void close_pgrp_pipe __P((void)); -+ extern void save_pgrp_pipe __P((int *, int)); -+ extern void restore_pgrp_pipe __P((int *)); - - #if defined (JOB_CONTROL) -*** ../bash-4.0-patched/trap.c 2009-01-16 17:07:53.000000000 -0500 ---- trap.c 2009-04-17 22:22:36.000000000 -0400 -*************** -*** 799,802 **** ---- 799,804 ---- - { - int trap_exit_value; -+ pid_t save_pgrp; -+ int save_pipe[2]; - - /* XXX - question: should the DEBUG trap inherit the RETURN trap? */ -*************** -*** 804,808 **** ---- 806,832 ---- - if ((sigmodes[DEBUG_TRAP] & SIG_TRAPPED) && ((sigmodes[DEBUG_TRAP] & SIG_IGNORED) == 0) && ((sigmodes[DEBUG_TRAP] & SIG_INPROGRESS) == 0)) - { -+ #if defined (JOB_CONTROL) -+ save_pgrp = pipeline_pgrp; -+ pipeline_pgrp = 0; -+ save_pipeline (1); -+ # if defined (PGRP_PIPE) -+ save_pgrp_pipe (save_pipe, 1); -+ # endif -+ stop_making_children (); -+ #endif -+ - trap_exit_value = _run_trap_internal (DEBUG_TRAP, "debug trap"); -+ -+ #if defined (JOB_CONTROL) -+ pipeline_pgrp = save_pgrp; -+ restore_pipeline (1); -+ # if defined (PGRP_PIPE) -+ close_pgrp_pipe (); -+ restore_pgrp_pipe (save_pipe); -+ # endif -+ if (pipeline_pgrp > 0) -+ give_terminal_to (pipeline_pgrp, 1); -+ notify_and_cleanup (); -+ #endif - - #if defined (DEBUGGER) -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 18 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 19 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-020 b/bash40-020 deleted file mode 100644 index 885f15e..0000000 --- a/bash40-020 +++ /dev/null @@ -1,83 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-020 - -Bug-Reported-by: Nicolai Lissner -Bug-Reference-ID: <20090412020510.GA29658@lilith> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00104.html - -Bug-Description: - -If a SIGWINCH arrives while bash is performing redisplay, multi-line prompts -are displayed incorrectly due to the display code being called recursively. - -Patch: - -*** ../bash-4.0-patched/lib/readline/readline.h 2009-01-04 14:32:33.000000000 -0500 ---- lib/readline/readline.h 2009-04-13 08:47:00.000000000 -0400 -*************** -*** 815,820 **** - #define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */ - #define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */ - -! #define RL_STATE_DONE 0x800000 /* done; accepted line */ - - #define RL_SETSTATE(x) (rl_readline_state |= (x)) ---- 815,821 ---- - #define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */ - #define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */ -+ #define RL_STATE_REDISPLAYING 0x800000 /* updating terminal display */ - -! #define RL_STATE_DONE 0x1000000 /* done; accepted line */ - - #define RL_SETSTATE(x) (rl_readline_state |= (x)) -*** ../bash-4.0-patched/lib/readline/display.c 2009-01-04 14:32:32.000000000 -0500 ---- lib/readline/display.c 2009-04-13 08:29:54.000000000 -0400 -*************** -*** 513,516 **** ---- 513,517 ---- - data structures. */ - _rl_block_sigint (); -+ RL_SETSTATE (RL_STATE_REDISPLAYING); - - if (!rl_display_prompt) -*************** -*** 1237,1240 **** ---- 1238,1242 ---- - } - -+ RL_UNSETSTATE (RL_STATE_REDISPLAYING); - _rl_release_sigint (); - } -*** ../bash-4.0-patched/lib/readline/terminal.c 2009-01-04 14:32:34.000000000 -0500 ---- lib/readline/terminal.c 2009-04-13 08:43:00.000000000 -0400 -*************** -*** 356,360 **** - if (CUSTOM_REDISPLAY_FUNC ()) - rl_forced_update_display (); -! else - _rl_redisplay_after_sigwinch (); - } ---- 356,360 ---- - if (CUSTOM_REDISPLAY_FUNC ()) - rl_forced_update_display (); -! else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0) - _rl_redisplay_after_sigwinch (); - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 19 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 20 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-021 b/bash40-021 deleted file mode 100644 index cf6ee1f..0000000 --- a/bash40-021 +++ /dev/null @@ -1,48 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-021 - -Bug-Reported-by: Matt Zyzik -Bug-Reference-ID: <20090319015542.696F62B8E8@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00149.html - -Bug-Description: - -When not in a locale supporting multibyte characters, readline will occasionally -not erase characters between the cursor position and the end of the line -when killing text backwards. - -Patch: - -*** ../bash-4.0-patched/lib/readline/display.c 2009-01-04 14:32:32.000000000 -0500 ---- lib/readline/display.c 2009-04-14 14:00:18.000000000 -0400 -*************** -*** 1775,1779 **** - adjust col_lendiff based on the difference between _rl_last_c_pos - and _rl_screenwidth */ -! if (col_lendiff && (_rl_last_c_pos < _rl_screenwidth)) - #endif - { ---- 1775,1779 ---- - adjust col_lendiff based on the difference between _rl_last_c_pos - and _rl_screenwidth */ -! if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth))) - #endif - { -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 20 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 21 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-022 b/bash40-022 deleted file mode 100644 index 5b68538..0000000 --- a/bash40-022 +++ /dev/null @@ -1,48 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-022 - -Bug-Reported-by: Bernd Eggink -Bug-Reference-ID: <49E65407.5010206@sudrala.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00118.html - -Bug-Description: - -When parsing case statements in command substitutions, the shell did not -note that a newline is a shell metacharacter and can legally be followed -by a reserved word (e.g., `esac'). - -Patch: - -*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.000000000 -0400 ---- parse.y 2009-04-15 22:27:56.000000000 -0400 -*************** -*** 3355,3359 **** - - /* Meta-characters that can introduce a reserved word. Not perfect yet. */ -! if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && shellmeta(ch)) - { - /* Add this character. */ ---- 3375,3379 ---- - - /* Meta-characters that can introduce a reserved word. Not perfect yet. */ -! if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) - { - /* Add this character. */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 21 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 22 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-023 b/bash40-023 deleted file mode 100644 index d2376c7..0000000 --- a/bash40-023 +++ /dev/null @@ -1,62 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-023 - -Bug-Reported-by: Andreas Schwab -Bug-Reference-ID: -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00160.html - -Bug-Description: - -If the prompt length exactly matches the screen width, and the prompt ends -with invisible characters, readline positions the cursor incorrectly. - -Patch: - -*** ../bash-4.0-patched/lib/readline/display.c 2009-01-04 14:32:32.000000000 -0500 ---- lib/readline/display.c 2009-04-25 21:42:18.000000000 -0400 -*************** -*** 1895,1898 **** ---- 1897,1904 ---- - woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset); - cpos = _rl_last_c_pos; -+ -+ if (cpos == 0 && cpos == new) -+ return; -+ - #if defined (HANDLE_MULTIBYTE) - /* If we have multibyte characters, NEW is indexed by the buffer point in -*************** -*** 1908,1914 **** - desired display position. */ - if ((new > prompt_last_invisible) || /* XXX - don't use woff here */ -! (prompt_physical_chars > _rl_screenwidth && - _rl_last_v_pos == prompt_last_screen_line && -! wrap_offset >= woff && - new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset))) - /* XXX last comparison might need to be >= */ ---- 1914,1920 ---- - desired display position. */ - if ((new > prompt_last_invisible) || /* XXX - don't use woff here */ -! (prompt_physical_chars >= _rl_screenwidth && - _rl_last_v_pos == prompt_last_screen_line && -! wrap_offset >= woff && dpos >= woff && - new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset))) - /* XXX last comparison might need to be >= */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 22 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 23 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-024 b/bash40-024 deleted file mode 100644 index ac2058a..0000000 --- a/bash40-024 +++ /dev/null @@ -1,112 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-024 - -Bug-Reported-by: Matt Zyzik -Bug-Reference-ID: <20090405205428.4FDEA1C7175@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00021.html - -Bug-Description: - -When using the ** globbing operator, bash will incorrectly add an extra -directory name when the preceding directory name ends with `*' or an empty -string when there is no preceding directory name. - -Patch: - -*** ../bash-4.0-patched/lib/glob/glob.c 2009-01-04 14:32:30.000000000 -0500 ---- lib/glob/glob.c 2009-04-28 10:22:29.000000000 -0400 -*************** -*** 357,361 **** - if (ep) - *ep = 0; -! if (r) - free (r); - return (struct globval *)0; ---- 357,361 ---- - if (ep) - *ep = 0; -! if (r && r != &glob_error_return) - free (r); - return (struct globval *)0; -*************** -*** 666,671 **** - } - -! /* compat: if GX_ALLDIRS, add the passed directory also */ -! if (add_current) - { - sdlen = strlen (dir); ---- 666,672 ---- - } - -! /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an -! empty directory name. */ -! if (add_current && (flags & GX_NULLDIR) == 0) - { - sdlen = strlen (dir); -*************** -*** 679,686 **** - nextlink->next = lastlink; - lastlink = nextlink; -! if (flags & GX_NULLDIR) -! nextname[0] = '\0'; -! else -! bcopy (dir, nextname, sdlen + 1); - ++count; - } ---- 680,684 ---- - nextlink->next = lastlink; - lastlink = nextlink; -! bcopy (dir, nextname, sdlen + 1); - ++count; - } -*************** -*** 943,947 **** - register unsigned int l; - -! array = glob_dir_to_array (directories[i], temp_results, flags); - l = 0; - while (array[l] != NULL) ---- 941,950 ---- - register unsigned int l; - -! /* If we're expanding **, we don't need to glue the directory -! name to the results; we've already done it in glob_vector */ -! if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') -! array = temp_results; -! else -! array = glob_dir_to_array (directories[i], temp_results, flags); - l = 0; - while (array[l] != NULL) -*************** -*** 960,964 **** - - /* Note that the elements of ARRAY are not freed. */ -! free ((char *) array); - } - } ---- 963,968 ---- - - /* Note that the elements of ARRAY are not freed. */ -! if (array != temp_results) -! free ((char *) array); - } - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 23 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 24 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-025 b/bash40-025 deleted file mode 100644 index 30b38ba..0000000 --- a/bash40-025 +++ /dev/null @@ -1,104 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-025 - -Bug-Reported-by: Matt Zyzik -Bug-Reference-ID: <20090519011418.GA21431@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00044.html - -Bug-Description: - -bash40-024 introduced a regression for constructs like **/*.cs; that -expansion would no longer include matching files in the current directory. -This patch undoes portions of bash40-024 and fixes the original problem -in a different way. - -Patch: - -*** ../bash-4.0-patched/lib/glob/glob.c 2009-05-22 12:32:26.000000000 -0400 ---- lib/glob/glob.c 2009-05-22 12:35:55.000000000 -0400 -*************** -*** 666,672 **** - } - -! /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an -! empty directory name. */ -! if (add_current && (flags & GX_NULLDIR) == 0) - { - sdlen = strlen (dir); ---- 666,673 ---- - } - -! /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty -! directory name as a placeholder if GX_NULLDIR (in which case the passed -! directory name is "."). */ -! if (add_current) - { - sdlen = strlen (dir); -*************** -*** 680,684 **** - nextlink->next = lastlink; - lastlink = nextlink; -! bcopy (dir, nextname, sdlen + 1); - ++count; - } ---- 681,688 ---- - nextlink->next = lastlink; - lastlink = nextlink; -! if (flags & GX_NULLDIR) -! nextname[0] = '\0'; -! else -! bcopy (dir, nextname, sdlen + 1); - ++count; - } -*************** -*** 1008,1016 **** - /* Just return what glob_vector () returns appended to the - directory name. */ - dflags = flags & ~GX_MARKDIRS; - if (directory_len == 0) - dflags |= GX_NULLDIR; - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') -! dflags |= GX_ALLDIRS|GX_ADDCURDIR; - temp_results = glob_vector (filename, - (directory_len == 0 ? "." : directory_name), ---- 1012,1033 ---- - /* Just return what glob_vector () returns appended to the - directory name. */ -+ /* If flags & GX_ALLDIRS, we're called recursively */ - dflags = flags & ~GX_MARKDIRS; - if (directory_len == 0) - dflags |= GX_NULLDIR; - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') -! { -! dflags |= GX_ALLDIRS|GX_ADDCURDIR; -! #if 0 -! /* If we want all directories (dflags & GX_ALLDIRS) and we're not -! being called recursively as something like `echo **/*.o' -! ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from -! adding a null directory name to the front of the temp_results -! array. We turn off ADDCURDIR if not called recursively and -! dlen == 0 */ -! #endif -! if (directory_len == 0 && (flags & GX_ALLDIRS) == 0) -! dflags &= ~GX_ADDCURDIR; -! } - temp_results = glob_vector (filename, - (directory_len == 0 ? "." : directory_name), -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 24 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 25 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-026 b/bash40-026 deleted file mode 100644 index 412b2c7..0000000 --- a/bash40-026 +++ /dev/null @@ -1,56 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-026 - -Bug-Reported-by: Sergei Steshenko -Bug-Reference-ID: <670181.38883.qm@web35204.mail.mud.yahoo.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00059.html - -Bug-Description: - -A forgotten line in externs.h caused compilation errors to occur on some -systems (e.g., Cygwin). - -Patch: - -*** ../bash-4.0-patched/externs.h 2009-01-18 18:29:29.000000000 -0500 ---- externs.h 2009-06-02 09:05:40.000000000 -0400 -*************** -*** 193,196 **** ---- 193,198 ---- - - /* Declarations for functions defined in lib/sh/fpurge.c */ -+ -+ #if defined NEED_FPURGE_DECL - #if !HAVE_DECL_FPURGE - -*************** -*** 201,205 **** - - #endif /* HAVE_DECL_FPURGE */ -! - - /* Declarations for functions defined in lib/sh/getcwd.c */ ---- 203,207 ---- - - #endif /* HAVE_DECL_FPURGE */ -! #endif /* NEED_FPURGE_DECL */ - - /* Declarations for functions defined in lib/sh/getcwd.c */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 25 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 26 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-027 b/bash40-027 deleted file mode 100644 index a96ce4b..0000000 --- a/bash40-027 +++ /dev/null @@ -1,67 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-027 - -Bug-Reported-by: jim@jim.sh -Bug-Reference-ID: <200905262140.n4QLeO4X030664@psychosis.jim.sh> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00074.html - -Bug-Description: - -There are occasional cursor positioning errors when using readline's -horizontal scroll mode. - -Patch: - -*** ../bash-4.0-patched/lib/readline/display.c 2009-05-22 12:32:25.000000000 -0400 ---- lib/readline/display.c 2009-05-29 23:32:20.000000000 -0400 -*************** -*** 1190,1196 **** - line[t - 1] = '>'; - -! if (!rl_display_fixed || forced_display || lmargin != last_lmargin) - { - forced_display = 0; - update_line (&visible_line[last_lmargin], - &invisible_line[lmargin], ---- 1192,1200 ---- - line[t - 1] = '>'; - -! if (rl_display_fixed == 0 || forced_display || lmargin != last_lmargin) - { - forced_display = 0; -+ o_cpos = _rl_last_c_pos; -+ cpos_adjusted = 0; - update_line (&visible_line[last_lmargin], - &invisible_line[lmargin], -*************** -*** 1200,1203 **** ---- 1204,1214 ---- - 0); - -+ if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && -+ cpos_adjusted == 0 && -+ _rl_last_c_pos != o_cpos && -+ _rl_last_c_pos > wrap_offset && -+ o_cpos < prompt_last_invisible) -+ _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ -+ - /* If the visible new line is shorter than the old, but the number - of invisible characters is greater, and we are at the end of -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 26 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 27 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-028 b/bash40-028 deleted file mode 100644 index a5b0b60..0000000 --- a/bash40-028 +++ /dev/null @@ -1,172 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-028 - -Bug-Reported-by: martin f krafft -Bug-Reference-ID: <4A4E39E7.5080807@debian.org> -Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165 - http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00011.html - -Bug-Description: - -bash-4.0 reverted to the historical shell behavior of raising an error -when $@ or $* was expanded after `set -u' had been executed and there -were no positional parameters. The Posix working group has since -clarified the standard's position on the issue, and $@ and $* are now the -only variables, parameters, or special parameters that do not raise an -error when unset if set -u is enabled. - -Patch: - -*** ../bash-4.0-patched/subst.c Mon Mar 23 11:34:55 2009 ---- subst.c Wed Jun 17 18:12:18 2009 -*************** -*** 6768,6778 **** - - case RBRACE: -! if (var_is_set == 0 && unbound_vars_is_error) - { - err_unboundvar (name); - FREE (value); - FREE (temp); - free (name); -- last_command_exit_value = EXECUTION_FAILURE; - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } ---- 6794,6804 ---- - - case RBRACE: -! if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) - { -+ last_command_exit_value = EXECUTION_FAILURE; - err_unboundvar (name); - FREE (value); - FREE (temp); - free (name); - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } -*************** -*** 6991,6994 **** ---- 7017,7029 ---- - list = list_rest_of_args (); - -+ #if 0 -+ /* According to austin-group posix proposal by Geoff Clare in -+ <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: -+ -+ "The shell shall write a message to standard error and -+ immediately exit when it tries to expand an unset parameter -+ other than the '@' and '*' special parameters." -+ */ -+ - if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { -*************** -*** 6996,7003 **** - uerror[1] = '*'; - uerror[2] = '\0'; -- err_unboundvar (uerror); - last_command_exit_value = EXECUTION_FAILURE; - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } - - /* If there are no command-line arguments, this should just ---- 7031,7039 ---- - uerror[1] = '*'; - uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; -+ err_unboundvar (uerror); - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } -+ #endif - - /* If there are no command-line arguments, this should just -*************** -*** 7053,7056 **** ---- 7089,7101 ---- - list = list_rest_of_args (); - -+ #if 0 -+ /* According to austin-group posix proposal by Geoff Clare in -+ <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: -+ -+ "The shell shall write a message to standard error and -+ immediately exit when it tries to expand an unset parameter -+ other than the '@' and '*' special parameters." -+ */ -+ - if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { -*************** -*** 7058,7065 **** - uerror[1] = '@'; - uerror[2] = '\0'; -- err_unboundvar (uerror); - last_command_exit_value = EXECUTION_FAILURE; - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } - - /* We want to flag the fact that we saw this. We can't turn ---- 7103,7111 ---- - uerror[1] = '@'; - uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; -+ err_unboundvar (uerror); - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } -+ #endif - - /* We want to flag the fact that we saw this. We can't turn -*** ../bash-4.0-patched/doc/bash.1 Wed Feb 18 15:13:56 2009 ---- doc/bash.1 Wed Jun 17 08:51:19 2009 -*************** -*** 8258,8264 **** - .TP 8 - .B \-u -! Treat unset variables as an error when performing - parameter expansion. If expansion is attempted on an -! unset variable, the shell prints an error message, and, - if not interactive, exits with a non-zero status. - .TP 8 ---- 8274,8281 ---- - .TP 8 - .B \-u -! Treat unset variables and parameters other than the special -! parameters "@" and "*" as an error when performing - parameter expansion. If expansion is attempted on an -! unset variable or parameter, the shell prints an error message, and, - if not interactive, exits with a non-zero status. - .TP 8 -*** ../bash-4.0-patched/doc/bashref.texi Wed Feb 18 15:14:43 2009 ---- doc/bashref.texi Wed Jun 17 08:50:46 2009 -*************** -*** 4139,4143 **** - - @item -u -! Treat unset variables as an error when performing parameter expansion. - An error message will be written to the standard error, and a non-interactive - shell will exit. ---- 4151,4156 ---- - - @item -u -! Treat unset variables and parameters other than the special parameters -! @samp{@@} or @samp{*} as an error when performing parameter expansion. - An error message will be written to the standard error, and a non-interactive - shell will exit. -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 27 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 28 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-029 b/bash40-029 deleted file mode 100644 index a13176d..0000000 --- a/bash40-029 +++ /dev/null @@ -1,106 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-029 - -Bug-Reported-by: Christian Krause -Bug-Reference-ID: Thu, 25 Jun 2009 21:47:59 +0200 -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-06/msg00078.html - -Bug-Description: - -Previous versions of bash accepted strings in the initial environment -that were not valid shell variable assignments, usually because the -names were invalid, but still created shell variables from them and -passed them to child processes in the environment. - -Bash-4.0 ignores those names and does not pass them to child processes. -Some users and automated processes depend on invalid variables being -ignored and passed to child processes. - -This patch makes bash continue to ignore the invalid names, but pass -them to child processes in the export environment. - -Patch: - -*** ../bash-4.0-patched/variables.c 2009-01-04 14:32:46.000000000 -0500 ---- variables.c 2009-06-29 09:17:20.000000000 -0400 -*************** -*** 253,256 **** ---- 255,259 ---- - static int visible_var __P((SHELL_VAR *)); - static int visible_and_exported __P((SHELL_VAR *)); -+ static int export_environment_candidate __P((SHELL_VAR *)); - static int local_and_exported __P((SHELL_VAR *)); - static int variable_in_context __P((SHELL_VAR *)); -*************** -*** 376,383 **** - # endif - #endif - else if (legal_identifier (name)) - { - temp_var = bind_variable (name, string, 0); -! VSETATTR (temp_var, (att_exported | att_imported)); - array_needs_making = 1; - } ---- 379,393 ---- - # endif - #endif -+ #if 0 - else if (legal_identifier (name)) -+ #else -+ else -+ #endif - { - temp_var = bind_variable (name, string, 0); -! if (legal_identifier (name)) -! VSETATTR (temp_var, (att_exported | att_imported)); -! else -! VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); - array_needs_making = 1; - } -*************** -*** 3083,3086 **** ---- 3098,3111 ---- - } - -+ /* Candidate variables for the export environment are either valid variables -+ with the export attribute or invalid variables inherited from the initial -+ environment and simply passed through. */ -+ static int -+ export_environment_candidate (var) -+ SHELL_VAR *var; -+ { -+ return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var))); -+ } -+ - /* Return non-zero if VAR is a local variable in the current context and - is exported. */ -*************** -*** 3439,3443 **** ---- 3464,3472 ---- - SHELL_VAR **vars; - -+ #if 0 - vars = map_over (visible_and_exported, vcxt); -+ #else -+ vars = map_over (export_environment_candidate, vcxt); -+ #endif - - if (vars == 0) -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 28 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 29 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-030 b/bash40-030 deleted file mode 100644 index e4f0389..0000000 --- a/bash40-030 +++ /dev/null @@ -1,64 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-030 - -Bug-Reported-by: Henning Bekel -Bug-Reference-ID: <7c6eacF262ctuU1@mid.individual.net> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00054.html - -Bug-Description: - -A shell function invoked with `bind -x' is supposed to be able to move the -cursor by setting READLINE_POINT. The effects of this assignment were -sometimes ignored. - -Patch: - -*** ../bash-4.0-patched/bashline.c 2009-01-08 09:29:24.000000000 -0500 ---- bashline.c 2009-07-16 14:13:41.000000000 -0400 -*************** -*** 3389,3393 **** - register int i; - intmax_t mi; -- int save_point; - sh_parser_state_t ps; - char *cmd, *value, *l; ---- 3389,3392 ---- -*************** -*** 3433,3437 **** - VSETATTR (v, att_exported); - l = value_cell (v); -- save_point = rl_point; - value = inttostr (rl_point, ibuf, sizeof (ibuf)); - v = bind_int_variable ("READLINE_POINT", value); ---- 3432,3435 ---- -*************** -*** 3451,3455 **** - { - i = mi; -! if (i != save_point) - { - rl_point = i; ---- 3449,3453 ---- - { - i = mi; -! if (i != rl_point) - { - rl_point = i; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 29 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 30 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-031 b/bash40-031 deleted file mode 100644 index db46aa3..0000000 --- a/bash40-031 +++ /dev/null @@ -1,62 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-031 - -Bug-Reported-by: Roman Rakus -Bug-Reference-ID: <4A93F6E9.4050401@redhat.com> -Bug-Reference-URL: - -Bug-Description: - -An implicit assignment to index "0" of an existing array variable caused -the shell to crash when the variable was unset. - -Patch: - -*** ../bash-4.0-patched/arrayfunc.c 2009-03-08 21:24:39.000000000 -0400 ---- arrayfunc.c 2009-08-24 09:29:43.000000000 -0400 -*************** -*** 99,103 **** - hash = assoc_create (0); - if (oldval) -! assoc_insert (hash, "0", oldval); - - FREE (value_cell (var)); ---- 99,103 ---- - hash = assoc_create (0); - if (oldval) -! assoc_insert (hash, savestring ("0"), oldval); - - FREE (value_cell (var)); -*** ../bash-4.0-patched/variables.c 2009-01-04 14:32:46.000000000 -0500 ---- variables.c 2009-08-24 09:29:58.000000000 -0400 -*************** -*** 2218,2222 **** - else if (assoc_p (entry)) - { -! assoc_insert (assoc_cell (entry), "0", newval); - free (newval); - } ---- 2218,2222 ---- - else if (assoc_p (entry)) - { -! assoc_insert (assoc_cell (entry), savestring ("0"), newval); - free (newval); - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 30 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 31 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-032 b/bash40-032 deleted file mode 100644 index 0c9ba74..0000000 --- a/bash40-032 +++ /dev/null @@ -1,46 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-032 - -Bug-Reported-by: muszi@muszi.kite.hu -Bug-Reference-ID: <20090826113159.18815.qmail@muszi.kite.hu> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-08/msg00090.html - -Bug-Description: - -Bash-4.0 has a memory leak when processing ${!prefix@}. - -Patch: - -*** ../bash-4.0-patched/subst.c 2009-07-22 23:18:55.000000000 -0400 ---- subst.c 2009-08-26 23:08:51.000000000 -0400 -*************** -*** 6607,6611 **** - } - free (x); -! free (xlist); - free (temp1); - *indexp = sindex; ---- 6769,6773 ---- - } - free (x); -! dispose_words (xlist); - free (temp1); - *indexp = sindex; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 31 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 32 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-033 b/bash40-033 deleted file mode 100644 index 80fcb6b..0000000 --- a/bash40-033 +++ /dev/null @@ -1,50 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-033 - -Bug-Reported-by: Dr. Werner Fink -Bug-Reference-ID: <200907010951.n619p76I013912@boole.suse.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00000.html - -Bug-Description: - -Bash-4.0 has a memory leak in the `read' builtin when the number of fields -read is not the same as the number of variables passed as arguments. - -Patch: - -*** ../bash-4.0-patched/builtins/read.def 2009-03-08 21:24:45.000000000 -0400 ---- builtins/read.def 2009-07-01 15:32:42.000000000 -0400 -*************** -*** 764,768 **** - tofree = input_string = t; - else -! input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); - } - #endif ---- 764,771 ---- - tofree = input_string = t; - else -! { -! input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); -! tofree = t; -! } - } - #endif -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 32 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 33 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-034 b/bash40-034 deleted file mode 100644 index bacb33c..0000000 --- a/bash40-034 +++ /dev/null @@ -1,59 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-034 - -Bug-Reported-by: Anders Kaseorg -Bug-Reference-ID: <1252856832.991059.8162.nullmailer@balanced-tree.mit.edu> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00043.html - -Bug-Description: - -When using the globstar option, bash incorrectly interprets wildcarded path -components between a **/ and the last / as matching any path, even if the -constructed path does not match any files. - -Patch: - -*** ../bash-4.0-patched/lib/glob/glob.c 2009-07-22 23:18:50.000000000 -0400 ---- lib/glob/glob.c 2009-09-18 17:53:25.000000000 -0400 -*************** -*** 920,928 **** - char **temp_results; - - /* Scan directory even on a NULL filename. That way, `*h/' - returns only directories ending in `h', instead of all - files ending in `h' with a `/' appended. */ - dname = directories[i]; -! dflags = flags & ~GX_MARKDIRS; - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') - dflags |= GX_ALLDIRS|GX_ADDCURDIR; ---- 927,938 ---- - char **temp_results; - -+ /* XXX -- we've recursively scanned any directories resulting from -+ a `**', so turn off the flag. We turn it on again below if -+ filename is `**' */ - /* Scan directory even on a NULL filename. That way, `*h/' - returns only directories ending in `h', instead of all - files ending in `h' with a `/' appended. */ - dname = directories[i]; -! dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR); - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') - dflags |= GX_ALLDIRS|GX_ADDCURDIR; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 33 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 34 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/bash40-035 b/bash40-035 deleted file mode 100644 index 3b1af75..0000000 --- a/bash40-035 +++ /dev/null @@ -1,62 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-035 - -Bug-Reported-by: Freddy Vulto -Bug-Reference-ID: -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00044.html - -Bug-Description: - -Bash-4.0 incorrectly treated single and double quotes as delimiters rather -than introducing quoted strings when splitting the line into words for -programmable completion functions. - -Patch: - -*** ../bash-4.0-patched/pcomplete.c 2009-03-08 21:24:31.000000000 -0400 ---- pcomplete.c 2009-09-26 16:30:16.000000000 -0400 -*************** -*** 1176,1186 **** - WORD_LIST *ret; - char *delims; - -! #if 0 -! delims = "()<>;&| \t\n"; /* shell metacharacters break words */ -! #else -! delims = rl_completer_word_break_characters; -! #endif - ret = split_at_delims (line, llen, delims, sentinel, nwp, cwp); - return (ret); - } ---- 1176,1188 ---- - WORD_LIST *ret; - char *delims; -+ int i, j; - -! delims = xmalloc (strlen (rl_completer_word_break_characters) + 1); -! for (i = j = 0; rl_completer_word_break_characters[i]; i++) -! if (rl_completer_word_break_characters[i] != '\'' && rl_completer_word_break_characters[i] != '"') -! delims[j++] = rl_completer_word_break_characters[i]; -! delims[j] = '\0'; - ret = split_at_delims (line, llen, delims, sentinel, nwp, cwp); -+ free (delims); - return (ret); - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 34 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 35 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/sources b/sources index ec7a1d5..9079200 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a90a1b5a6db4838483f05438e05e8eb9 bash-4.0.tar.gz +fc8de7b0c715fe043129c9e347a5658c bash-4.1-rc1.tar.gz