7 Bug-Reported-by: rew@erebor.com
8 Bug-Reference-ID: <20070119065603.546D011E9C@kansas.erebor.com>
13 Bash-3.2 changed the behavior of the [[ command's `=~' operator when the
14 right-hand side was quoted: it matched the quoted portions as strings.
15 This patch introduces a new shell option: compat31. When enabled, it
16 restores the bash-3.1 behavior with respect to evaluating quoted arguments
21 *** ../bash-3.2-patched/execute_cmd.c 2007-12-14 21:12:39.000000000 -0500
22 --- bash-3.2/execute_cmd.c 2008-02-22 21:20:40.000000000 -0500
27 ! arg2 = cond_expand_word (cond->right->op, rmatch ? 2 : (patmatch ? 1 : 0));
33 ! arg2 = cond_expand_word (cond->right->op,
34 ! (rmatch && shell_compatibility_level > 31) ? 2 : (patmatch ? 1 : 0));
37 *** ../bash-3.2-patched/shell.h 2003-06-01 15:04:36.000000000 -0400
38 --- bash-3.2/shell.h 2008-02-22 21:16:48.000000000 -0500
42 extern int interactive, interactive_shell;
43 extern int startup_state;
44 + extern int shell_compatibility_level;
46 /* Structure to pass around that holds a bitmap of file descriptors
47 *** ../bash-3.2-patched/version.c 2007-12-14 21:12:29.000000000 -0500
48 --- bash-3.2/version.c 2008-04-10 08:22:22.000000000 -0400
52 const char *sccs_version = SCCSVERSION;
54 + /* If == 31, shell compatible with bash-3.1, == 32 with bash-3.2, and so on */
55 + int shell_compatibility_level = 32;
57 /* Functions for getting, setting, and displaying the shell version. */
59 *** ../bash-3.2-patched/builtins/shopt.def 2005-02-19 17:25:03.000000000 -0500
60 --- bash-3.2/builtins/shopt.def 2008-04-10 08:13:32.000000000 -0400
64 static int set_shellopts_after_change __P((int));
66 + static int set_compatibility_level __P((int));
68 #if defined (RESTRICTED_SHELL)
69 static int set_restricted_shell __P((int));
74 static int shopt_login_shell;
75 + static int shopt_compat31;
77 typedef int shopt_set_func_t __P((int));
81 { "cmdhist", &command_oriented_history, (shopt_set_func_t *)NULL },
83 + { "compat31", &shopt_compat31, set_compatibility_level },
84 { "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL },
85 { "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL },
92 + set_compatibility_level (mode)
95 + /* Need to change logic here as we add more compatibility levels */
97 + shell_compatibility_level = 31;
99 + shell_compatibility_level = 32;
103 #if defined (RESTRICTED_SHELL)
104 /* Don't allow the value of restricted_shell to be modified. */
105 *** ../bash-3.2-patched/doc/bash.1 2006-09-28 10:26:05.000000000 -0400
106 --- bash-3.2/doc/bash.1 2008-04-25 12:32:49.000000000 -0400
110 easy re-editing of multi-line commands.
115 + changes its behavior to that of version 3.1 with respect to quoted
116 + arguments to the conditional command's =~ operator.
120 *** ../bash-20080214/doc/bashref.texi 2008-02-08 21:28:35.000000000 -0500
121 --- bash-3.2/doc/bashref.texi 2008-02-22 21:44:51.000000000 -0500
125 easy re-editing of multi-line commands.
129 + changes its behavior to that of version 3.1 with respect to quoted
130 + arguments to the conditional command's =~ operator.
133 If set, Bash includes filenames beginning with a `.' in
134 *** ../bash-3.2-patched/tests/shopt.right 2005-02-19 17:46:09.000000000 -0500
135 --- bash-3.2/tests/shopt.right 2008-04-28 09:13:07.000000000 -0400
139 shopt -u checkwinsize
148 shopt -u checkwinsize
161 *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
162 --- bash-3.2/patchlevel.h Mon Oct 16 14:22:54 2006
165 looks for to find the patch level (for the sccs version string). */
167 ! #define PATCHLEVEL 38
169 #endif /* _PATCHLEVEL_H_ */
171 looks for to find the patch level (for the sccs version string). */
173 ! #define PATCHLEVEL 39
175 #endif /* _PATCHLEVEL_H_ */