Bläddra i källkod

bash: Add upstream patches

Signed-off-by: Marcel Denia <naoir@gmx.net>
Marcel Denia 10 år sedan
förälder
incheckning
bdbd767fac

+ 49
- 0
utils/bash/patches/101-upstream-bash43-001.patch Visa fil

@@ -0,0 +1,49 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-001
6
+
7
+Bug-Reported-by:	NBaH <nbah@sfr.fr>
8
+Bug-Reference-ID:	<ler0b5$iu9$1@speranza.aioe.org>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00092.html
10
+
11
+Bug-Description:
12
+
13
+A missing check for a valid option prevented `test -R' from working.  There
14
+is another problem that causes bash to look up the wrong variable name when
15
+processing the argument to `test -R'.
16
+
17
+Patch (apply with `patch -p0'):
18
+
19
+--- a/test.c
20
++++ b/test.c
21
+@@ -646,8 +646,8 @@ unary_test (op, arg)
22
+       return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE);
23
+ 
24
+     case 'R':
25
+-      v = find_variable (arg);
26
+-      return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);
27
++      v = find_variable_noref (arg);
28
++      return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE);
29
+     }
30
+ 
31
+   /* We can't actually get here, but this shuts up gcc. */
32
+@@ -723,6 +723,7 @@ test_unop (op)
33
+     case 'o': case 'p': case 'r': case 's': case 't':
34
+     case 'u': case 'v': case 'w': case 'x': case 'z':
35
+     case 'G': case 'L': case 'O': case 'S': case 'N':
36
++    case 'R':
37
+       return (1);
38
+     }
39
+ 
40
+--- a/patchlevel.h
41
++++ b/patchlevel.h
42
+@@ -25,6 +25,6 @@
43
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
44
+    looks for to find the patch level (for the sccs version string). */
45
+ 
46
+-#define PATCHLEVEL 0
47
++#define PATCHLEVEL 1
48
+ 
49
+ #endif /* _PATCHLEVEL_H_ */

+ 49
- 0
utils/bash/patches/102-upstream-bash43-002.patch Visa fil

@@ -0,0 +1,49 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-002
6
+
7
+Bug-Reported-by:	Moe Tunes <moetunes42@gmail.com>
8
+Bug-Reference-ID:	<53103F49.3070100@gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00086.html
10
+
11
+Bug-Description:
12
+
13
+A change to save state while running the DEBUG trap caused pipelines to hang
14
+on systems which need process group synchronization while building pipelines.
15
+
16
+Patch (apply with `patch -p0'):
17
+
18
+--- a/trap.c
19
++++ b/trap.c
20
+@@ -920,7 +920,8 @@ _run_trap_internal (sig, tag)
21
+       subst_assign_varlist = 0;
22
+ 
23
+ #if defined (JOB_CONTROL)
24
+-      save_pipeline (1);	/* XXX only provides one save level */
25
++      if (sig != DEBUG_TRAP)	/* run_debug_trap does this */
26
++	save_pipeline (1);	/* XXX only provides one save level */
27
+ #endif
28
+ 
29
+       /* If we're in a function, make sure return longjmps come here, too. */
30
+@@ -940,7 +941,8 @@ _run_trap_internal (sig, tag)
31
+       trap_exit_value = last_command_exit_value;
32
+ 
33
+ #if defined (JOB_CONTROL)
34
+-      restore_pipeline (1);
35
++      if (sig != DEBUG_TRAP)	/* run_debug_trap does this */
36
++	restore_pipeline (1);
37
+ #endif
38
+ 
39
+       subst_assign_varlist = save_subst_varlist;
40
+--- a/patchlevel.h
41
++++ b/patchlevel.h
42
+@@ -25,6 +25,6 @@
43
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
44
+    looks for to find the patch level (for the sccs version string). */
45
+ 
46
+-#define PATCHLEVEL 1
47
++#define PATCHLEVEL 2
48
+ 
49
+ #endif /* _PATCHLEVEL_H_ */

+ 39
- 0
utils/bash/patches/103-upstream-bash43-003.patch Visa fil

@@ -0,0 +1,39 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-003
6
+
7
+Bug-Reported-by:	Anatol Pomozov <anatol.pomozov@gmail.com>
8
+Bug-Reference-ID:	<CAOMFOmXy3mT2So5GQ5F-smCVArQuAeBwZ2QKzgCtMeXJoDeYOQ@mail.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html
10
+
11
+Bug-Description:
12
+
13
+When in callback mode, some readline commands can cause readline to seg
14
+fault by passing invalid contexts to callback functions.
15
+
16
+Patch (apply with `patch -p0'):
17
+
18
+--- a/lib/readline/readline.c
19
++++ b/lib/readline/readline.c
20
+@@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt)
21
+     r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
22
+ 
23
+   RL_CHECK_SIGNALS ();
24
+-  if (r == 0)			/* success! */
25
++  /* We only treat values < 0 specially to simulate recursion. */
26
++  if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0))	/* success! or failure! */
27
+     {
28
+       _rl_keyseq_chain_dispose ();
29
+       RL_UNSETSTATE (RL_STATE_MULTIKEY);
30
+--- a/patchlevel.h
31
++++ b/patchlevel.h
32
+@@ -25,6 +25,6 @@
33
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
34
+    looks for to find the patch level (for the sccs version string). */
35
+ 
36
+-#define PATCHLEVEL 2
37
++#define PATCHLEVEL 3
38
+ 
39
+ #endif /* _PATCHLEVEL_H_ */

+ 38
- 0
utils/bash/patches/104-upstream-bash43-004.patch Visa fil

@@ -0,0 +1,38 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-004
6
+
7
+Bug-Reported-by:	Daan van Rossum <daan@flash.uchicago.edu>
8
+Bug-Reference-ID:	<20140307072523.GA14250@flash.uchicago.edu>
9
+Bug-Reference-URL:	
10
+
11
+Bug-Description:
12
+
13
+The `.' command in vi mode cannot undo multi-key commands beginning with
14
+`c', `d', and `y' (command plus motion specifier).
15
+
16
+Patch (apply with `patch -p0'):
17
+
18
+--- a/lib/readline/readline.c
19
++++ b/lib/readline/readline.c
20
+@@ -965,7 +965,7 @@ _rl_dispatch_subseq (key, map, got_subse
21
+ #if defined (VI_MODE)
22
+   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
23
+       key != ANYOTHERKEY &&
24
+-      rl_key_sequence_length == 1 &&	/* XXX */
25
++      _rl_dispatching_keymap == vi_movement_keymap &&
26
+       _rl_vi_textmod_command (key))
27
+     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
28
+ #endif
29
+--- a/patchlevel.h
30
++++ b/patchlevel.h
31
+@@ -25,6 +25,6 @@
32
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
33
+    looks for to find the patch level (for the sccs version string). */
34
+ 
35
+-#define PATCHLEVEL 3
36
++#define PATCHLEVEL 4
37
+ 
38
+ #endif /* _PATCHLEVEL_H_ */

+ 50
- 0
utils/bash/patches/105-upstream-bash43-005.patch Visa fil

@@ -0,0 +1,50 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-005
6
+
7
+Bug-Reported-by:	David Sines <dave.gma@googlemail.com>
8
+Bug-Reference-ID:	<CAO3BAa_CK_Rgkhdfzs+NJ4KFYdB9qW3pvXQK0xLCi6GMmDU8bw@mail.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00037.html
10
+
11
+Bug-Description:
12
+
13
+When in Posix mode, bash did not correctly interpret the ANSI-C-style
14
+$'...' quoting mechanism when performing pattern substitution word
15
+expansions within double quotes.
16
+
17
+Patch (apply with `patch -p0'):
18
+
19
+--- a/parse.y
20
++++ b/parse.y
21
+@@ -3398,7 +3398,7 @@ parse_matched_pair (qc, open, close, len
22
+          within a double-quoted ${...} construct "an even number of
23
+          unescaped double-quotes or single-quotes, if any, shall occur." */
24
+       /* This was changed in Austin Group Interp 221 */
25
+-      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
26
++      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
27
+ 	continue;
28
+ 
29
+       /* Could also check open == '`' if we want to parse grouping constructs
30
+--- a/y.tab.c
31
++++ b/y.tab.c
32
+@@ -5710,7 +5710,7 @@ parse_matched_pair (qc, open, close, len
33
+          within a double-quoted ${...} construct "an even number of
34
+          unescaped double-quotes or single-quotes, if any, shall occur." */
35
+       /* This was changed in Austin Group Interp 221 */
36
+-      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
37
++      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
38
+ 	continue;
39
+ 
40
+       /* Could also check open == '`' if we want to parse grouping constructs
41
+--- a/patchlevel.h
42
++++ b/patchlevel.h
43
+@@ -25,6 +25,6 @@
44
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
45
+    looks for to find the patch level (for the sccs version string). */
46
+ 
47
+-#define PATCHLEVEL 4
48
++#define PATCHLEVEL 5
49
+ 
50
+ #endif /* _PATCHLEVEL_H_ */

+ 39
- 0
utils/bash/patches/106-upstream-bash43-006.patch Visa fil

@@ -0,0 +1,39 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-006
6
+
7
+Bug-Reported-by:	Eduardo A . Bustamante Lopez <dualbus@gmail.com>
8
+Bug-Reference-ID:	<20140228170013.GA16015@dualbus.me>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00091.html
10
+
11
+Bug-Description:
12
+
13
+A shell that started with job control active but was not interactive left
14
+the terminal in the wrong process group when exiting, causing its parent
15
+shell to get a stop signal when it attempted to read from the terminal.
16
+
17
+Patch (apply with `patch -p0'):
18
+
19
+--- a/jobs.c
20
++++ b/jobs.c
21
+@@ -4374,7 +4374,7 @@ without_job_control ()
22
+ void
23
+ end_job_control ()
24
+ {
25
+-  if (interactive_shell)		/* XXX - should it be interactive? */
26
++  if (interactive_shell || job_control)		/* XXX - should it be just job_control? */
27
+     {
28
+       terminate_stopped_jobs ();
29
+ 
30
+--- a/patchlevel.h
31
++++ b/patchlevel.h
32
+@@ -25,6 +25,6 @@
33
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
34
+    looks for to find the patch level (for the sccs version string). */
35
+ 
36
+-#define PATCHLEVEL 5
37
++#define PATCHLEVEL 6
38
+ 
39
+ #endif /* _PATCHLEVEL_H_ */

+ 45
- 0
utils/bash/patches/107-upstream-bash43-007.patch Visa fil

@@ -0,0 +1,45 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-007
6
+
7
+Bug-Reported-by:	geir.hauge@gmail.com
8
+Bug-Reference-ID:	<20140318093650.B181C1C5B0B@gina.itea.ntnu.no>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00095.html
10
+
11
+Bug-Description:
12
+
13
+Using compound assignments for associative arrays like
14
+
15
+assoc=( [x]= [y]=bar )
16
+
17
+left the value corresponding to the key `x' NULL.  This caused subsequent
18
+lookups to interpret it as unset.
19
+
20
+Patch (apply with `patch -p0'):
21
+
22
+--- a/arrayfunc.c
23
++++ b/arrayfunc.c
24
+@@ -597,6 +597,11 @@ assign_compound_array_list (var, nlist,
25
+       if (assoc_p (var))
26
+ 	{
27
+ 	  val = expand_assignment_string_to_string (val, 0);
28
++	  if (val == 0)
29
++	    {
30
++	      val = (char *)xmalloc (1);
31
++	      val[0] = '\0';	/* like do_assignment_internal */
32
++	    }
33
+ 	  free_val = 1;
34
+ 	}
35
+ 
36
+--- a/patchlevel.h
37
++++ b/patchlevel.h
38
+@@ -25,6 +25,6 @@
39
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
40
+    looks for to find the patch level (for the sccs version string). */
41
+ 
42
+-#define PATCHLEVEL 6
43
++#define PATCHLEVEL 7
44
+ 
45
+ #endif /* _PATCHLEVEL_H_ */

+ 148
- 0
utils/bash/patches/108-upstream-bash43-008.patch Visa fil

@@ -0,0 +1,148 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-008
6
+
7
+Bug-Reported-by:	Stephane Chazelas <stephane.chazelas@gmail.com>
8
+Bug-Reference-ID:	<20140318135901.GB22158@chaz.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00098.html
10
+
11
+Bug-Description:
12
+
13
+Some extended glob patterns incorrectly matched filenames with a leading
14
+dot, regardless of the setting of the `dotglob' option.
15
+
16
+Patch (apply with `patch -p0'):
17
+
18
+--- a/lib/glob/gmisc.c
19
++++ b/lib/glob/gmisc.c
20
+@@ -210,6 +210,7 @@ extglob_pattern_p (pat)
21
+     case '+':
22
+     case '!':
23
+     case '@':
24
++    case '?':
25
+       return (pat[1] == LPAREN);
26
+     default:
27
+       return 0;
28
+--- a/lib/glob/glob.c
29
++++ b/lib/glob/glob.c
30
+@@ -179,42 +179,50 @@ extglob_skipname (pat, dname, flags)
31
+      char *pat, *dname;
32
+      int flags;
33
+ {
34
+-  char *pp, *pe, *t;
35
+-  int n, r;
36
++  char *pp, *pe, *t, *se;
37
++  int n, r, negate;
38
+ 
39
++  negate = *pat == '!';
40
+   pp = pat + 2;
41
+-  pe = pp + strlen (pp) - 1;	/*(*/
42
+-  if (*pe != ')')
43
+-    return 0;
44
+-  if ((t = strchr (pp, '|')) == 0)	/* easy case first */
45
++  se = pp + strlen (pp) - 1;		/* end of string */
46
++  pe = glob_patscan (pp, se, 0);	/* end of extglob pattern (( */
47
++  /* we should check for invalid extglob pattern here */
48
++  /* if pe != se we have more of the pattern at the end of the extglob
49
++     pattern. Check the easy case first ( */
50
++  if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
51
+     {
52
+       *pe = '\0';
53
++#if defined (HANDLE_MULTIBYTE)
54
++      r = mbskipname (pp, dname, flags);
55
++#else
56
+       r = skipname (pp, dname, flags);	/*(*/
57
++#endif
58
+       *pe = ')';
59
+       return r;
60
+     }
61
++
62
++  /* check every subpattern */
63
+   while (t = glob_patscan (pp, pe, '|'))
64
+     {
65
+       n = t[-1];
66
+       t[-1] = '\0';
67
++#if defined (HANDLE_MULTIBYTE)
68
++      r = mbskipname (pp, dname, flags);
69
++#else
70
+       r = skipname (pp, dname, flags);
71
++#endif
72
+       t[-1] = n;
73
+       if (r == 0)	/* if any pattern says not skip, we don't skip */
74
+         return r;
75
+       pp = t;
76
+     }	/*(*/
77
+ 
78
+-  if (pp == pe)		/* glob_patscan might find end of pattern */
79
++  /* glob_patscan might find end of pattern */
80
++  if (pp == se)
81
+     return r;
82
+ 
83
+-  *pe = '\0';
84
+-#  if defined (HANDLE_MULTIBYTE)
85
+-  r = mbskipname (pp, dname, flags);	/*(*/
86
+-#  else
87
+-  r = skipname (pp, dname, flags);	/*(*/
88
+-#  endif
89
+-  *pe = ')';
90
+-  return r;
91
++  /* but if it doesn't then we didn't match a leading dot */
92
++  return 0;
93
+ }
94
+ #endif
95
+ 
96
+@@ -277,20 +285,23 @@ wextglob_skipname (pat, dname, flags)
97
+      int flags;
98
+ {
99
+ #if EXTENDED_GLOB
100
+-  wchar_t *pp, *pe, *t, n;
101
+-  int r;
102
++  wchar_t *pp, *pe, *t, n, *se;
103
++  int r, negate;
104
+ 
105
++  negate = *pat == L'!';
106
+   pp = pat + 2;
107
+-  pe = pp + wcslen (pp) - 1;	/*(*/
108
+-  if (*pe != L')')
109
+-    return 0;
110
+-  if ((t = wcschr (pp, L'|')) == 0)
111
++  se = pp + wcslen (pp) - 1;	/*(*/
112
++  pe = glob_patscan_wc (pp, se, 0);
113
++
114
++  if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0)
115
+     {
116
+       *pe = L'\0';
117
+       r = wchkname (pp, dname); /*(*/
118
+       *pe = L')';
119
+       return r;
120
+     }
121
++
122
++  /* check every subpattern */
123
+   while (t = glob_patscan_wc (pp, pe, '|'))
124
+     {
125
+       n = t[-1];
126
+@@ -305,10 +316,8 @@ wextglob_skipname (pat, dname, flags)
127
+   if (pp == pe)		/* glob_patscan_wc might find end of pattern */
128
+     return r;
129
+ 
130
+-  *pe = L'\0';
131
+-  r = wchkname (pp, dname);	/*(*/
132
+-  *pe = L')';
133
+-  return r;
134
++  /* but if it doesn't then we didn't match a leading dot */
135
++  return 0;
136
+ #else
137
+   return (wchkname (pat, dname));
138
+ #endif
139
+--- a/patchlevel.h
140
++++ b/patchlevel.h
141
+@@ -25,6 +25,6 @@
142
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
143
+    looks for to find the patch level (for the sccs version string). */
144
+ 
145
+-#define PATCHLEVEL 7
146
++#define PATCHLEVEL 8
147
+ 
148
+ #endif /* _PATCHLEVEL_H_ */

+ 51
- 0
utils/bash/patches/109-upstream-bash43-009.patch Visa fil

@@ -0,0 +1,51 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-009
6
+
7
+Bug-Reported-by:	Matthias Klose <doko@debian.org>
8
+Bug-Reference-ID:	<53346FC8.6090005@debian.org>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00171.html
10
+
11
+Bug-Description:
12
+
13
+There is a problem with unsigned sign extension when attempting to reallocate
14
+the input line when it is fewer than 3 characters long and there has been a
15
+history expansion.  The sign extension causes the shell to not reallocate the
16
+line, which results in a segmentation fault when it writes past the end.
17
+
18
+Patch (apply with `patch -p0'):
19
+
20
+--- a/parse.y
21
++++ b/parse.y
22
+@@ -2424,7 +2424,7 @@ shell_getc (remove_quoted_newline)
23
+ 	 not already end in an EOF character.  */
24
+       if (shell_input_line_terminator != EOF)
25
+ 	{
26
+-	  if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
27
++	  if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
28
+ 	    shell_input_line = (char *)xrealloc (shell_input_line,
29
+ 					1 + (shell_input_line_size += 2));
30
+ 
31
+--- a/y.tab.c
32
++++ b/y.tab.c
33
+@@ -4736,7 +4736,7 @@ shell_getc (remove_quoted_newline)
34
+ 	 not already end in an EOF character.  */
35
+       if (shell_input_line_terminator != EOF)
36
+ 	{
37
+-	  if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
38
++	  if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
39
+ 	    shell_input_line = (char *)xrealloc (shell_input_line,
40
+ 					1 + (shell_input_line_size += 2));
41
+ 
42
+--- a/patchlevel.h
43
++++ b/patchlevel.h
44
+@@ -25,6 +25,6 @@
45
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
46
+    looks for to find the patch level (for the sccs version string). */
47
+ 
48
+-#define PATCHLEVEL 8
49
++#define PATCHLEVEL 9
50
+ 
51
+ #endif /* _PATCHLEVEL_H_ */

+ 145
- 0
utils/bash/patches/110-upstream-bash43-010.patch Visa fil

@@ -0,0 +1,145 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-010
6
+
7
+Bug-Reported-by:	Albert Shih <Albert.Shih@obspm.fr>
8
+Bug-Reference-ID:	Wed, 5 Mar 2014 23:01:40 +0100
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00028.html
10
+
11
+Bug-Description:
12
+
13
+Patch (apply with `patch -p0'):
14
+
15
+This patch changes the behavior of programmable completion to compensate
16
+for two assumptions made by the bash-completion package.  Bash-4.3 changed
17
+to dequote the argument to programmable completion only under certain
18
+circumstances, to make the behavior of compgen more consistent when run
19
+from the command line -- closer to the behavior when run by a shell function
20
+run as part of programmable completion.  Bash-completion can pass quoted
21
+arguments to compgen when the original word to be completed was not quoted,
22
+expecting programmable completion to dequote the word before attempting
23
+completion.
24
+
25
+This patch fixes two cases:
26
+
27
+1.  An empty string that bash-completion passes to compgen as a quoted null
28
+    string ('').
29
+
30
+2.  An unquoted word that bash-completion quotes using single quotes or
31
+    backslashes before passing it to compgen.
32
+
33
+In these cases, since readline did not detect a quote character in the original
34
+word to be completed, bash-4.3 
35
+
36
+--- a/externs.h
37
++++ b/externs.h
38
+@@ -324,6 +324,7 @@ extern char *sh_un_double_quote __P((cha
39
+ extern char *sh_backslash_quote __P((char *, const char *, int));
40
+ extern char *sh_backslash_quote_for_double_quotes __P((char *));
41
+ extern int sh_contains_shell_metas __P((char *));
42
++extern int sh_contains_quotes __P((char *));
43
+ 
44
+ /* declarations for functions defined in lib/sh/spell.c */
45
+ extern int spname __P((char *, char *));
46
+--- a/lib/sh/shquote.c
47
++++ b/lib/sh/shquote.c
48
+@@ -311,3 +311,17 @@ sh_contains_shell_metas (string)
49
+ 
50
+   return (0);
51
+ }
52
++
53
++int
54
++sh_contains_quotes (string)
55
++     char *string;
56
++{
57
++  char *s;
58
++
59
++  for (s = string; s && *s; s++)
60
++    {
61
++      if (*s == '\'' || *s == '"' || *s == '\\')
62
++	return 1;
63
++    }
64
++  return 0;
65
++}
66
+--- a/pcomplete.c
67
++++ b/pcomplete.c
68
+@@ -183,6 +183,7 @@ ITEMLIST it_variables = { LIST_DYNAMIC,
69
+ 
70
+ COMPSPEC *pcomp_curcs;
71
+ const char *pcomp_curcmd;
72
++const char *pcomp_curtxt;
73
+ 
74
+ #ifdef DEBUG
75
+ /* Debugging code */
76
+@@ -753,6 +754,32 @@ pcomp_filename_completion_function (text
77
+ 	     quoted strings. */
78
+ 	  dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
79
+ 	}
80
++      /* Intended to solve a mismatched assumption by bash-completion.  If
81
++	 the text to be completed is empty, but bash-completion turns it into
82
++	 a quoted string ('') assuming that this code will dequote it before
83
++	 calling readline, do the dequoting. */
84
++      else if (iscompgen && iscompleting &&
85
++	       pcomp_curtxt && *pcomp_curtxt == 0 &&
86
++	       text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && 
87
++	       rl_filename_dequoting_function)
88
++	dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
89
++      /* Another mismatched assumption by bash-completion.  If compgen is being
90
++      	 run as part of bash-completion, and the argument to compgen is not
91
++      	 the same as the word originally passed to the programmable completion
92
++      	 code, dequote the argument if it has quote characters.  It's an
93
++      	 attempt to detect when bash-completion is quoting its filename
94
++      	 argument before calling compgen. */
95
++      /* We could check whether gen_shell_function_matches is in the call
96
++	 stack by checking whether the gen-shell-function-matches tag is in
97
++	 the unwind-protect stack, but there's no function to do that yet.
98
++	 We could simply check whether we're executing in a function by
99
++	 checking variable_context, and may end up doing that. */
100
++      else if (iscompgen && iscompleting && rl_filename_dequoting_function &&
101
++	       pcomp_curtxt && text &&
102
++	       STREQ (pcomp_curtxt, text) == 0 &&
103
++	       variable_context &&
104
++	       sh_contains_quotes (text))	/* guess */
105
++	dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
106
+       else
107
+ 	dfn = savestring (text);
108
+     }
109
+@@ -1522,7 +1549,7 @@ gen_progcomp_completions (ocmd, cmd, wor
110
+      COMPSPEC **lastcs;
111
+ {
112
+   COMPSPEC *cs, *oldcs;
113
+-  const char *oldcmd;
114
++  const char *oldcmd, *oldtxt;
115
+   STRINGLIST *ret;
116
+ 
117
+   cs = progcomp_search (ocmd);
118
+@@ -1545,14 +1572,17 @@ gen_progcomp_completions (ocmd, cmd, wor
119
+ 
120
+   oldcs = pcomp_curcs;
121
+   oldcmd = pcomp_curcmd;
122
++  oldtxt = pcomp_curtxt;
123
+ 
124
+   pcomp_curcs = cs;
125
+   pcomp_curcmd = cmd;
126
++  pcomp_curtxt = word;
127
+ 
128
+   ret = gen_compspec_completions (cs, cmd, word, start, end, foundp);
129
+ 
130
+   pcomp_curcs = oldcs;
131
+   pcomp_curcmd = oldcmd;
132
++  pcomp_curtxt = oldtxt;
133
+ 
134
+   /* We need to conditionally handle setting *retryp here */
135
+   if (retryp)
136
+--- a/patchlevel.h
137
++++ b/patchlevel.h
138
+@@ -25,6 +25,6 @@
139
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
140
+    looks for to find the patch level (for the sccs version string). */
141
+ 
142
+-#define PATCHLEVEL 9
143
++#define PATCHLEVEL 10
144
+ 
145
+ #endif /* _PATCHLEVEL_H_ */

+ 40
- 0
utils/bash/patches/111-upstream-bash43-011.patch Visa fil

@@ -0,0 +1,40 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-011
6
+
7
+Bug-Reported-by:	Egmont Koblinger <egmont@gmail.com>
8
+Bug-Reference-ID:	<CAGWcZk+bU5Jo1M+tutGvL-250UBE9DXjpeJVofYJSFcqFEVfMg@mail.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00153.html
10
+
11
+Bug-Description:
12
+
13
+The signal handling changes to bash and readline (to avoid running any code
14
+in a signal handler context) cause the cursor to be placed on the wrong
15
+line of a multi-line command after a ^C interrupts editing.
16
+
17
+Patch (apply with `patch -p0'):
18
+
19
+--- a/lib/readline/display.c
20
++++ b/lib/readline/display.c
21
+@@ -2677,7 +2677,8 @@ _rl_clean_up_for_exit ()
22
+ {
23
+   if (_rl_echoing_p)
24
+     {
25
+-      _rl_move_vert (_rl_vis_botlin);
26
++      if (_rl_vis_botlin > 0)	/* minor optimization plus bug fix */
27
++	_rl_move_vert (_rl_vis_botlin);
28
+       _rl_vis_botlin = 0;
29
+       fflush (rl_outstream);
30
+       rl_restart_output (1, 0);
31
+--- a/patchlevel.h
32
++++ b/patchlevel.h
33
+@@ -25,6 +25,6 @@
34
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
35
+    looks for to find the patch level (for the sccs version string). */
36
+ 
37
+-#define PATCHLEVEL 10
38
++#define PATCHLEVEL 11
39
+ 
40
+ #endif /* _PATCHLEVEL_H_ */

+ 38
- 0
utils/bash/patches/112-upstream-bash43-012.patch Visa fil

@@ -0,0 +1,38 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-012
6
+
7
+Bug-Reported-by:	Eduardo A. Bustamante López<dualbus@gmail.com>
8
+Bug-Reference-ID:	<5346B54C.4070205@case.edu>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00051.html
10
+
11
+Bug-Description:
12
+
13
+When a SIGCHLD trap runs a command containing a shell builtin while
14
+a script is running `wait' to wait for all running children to complete,
15
+the SIGCHLD trap will not be run once for each child that terminates.
16
+
17
+Patch (apply with `patch -p0'):
18
+
19
+--- a/jobs.c
20
++++ b/jobs.c
21
+@@ -3597,6 +3597,7 @@ run_sigchld_trap (nchild)
22
+   unwind_protect_int (jobs_list_frozen);
23
+   unwind_protect_pointer (the_pipeline);
24
+   unwind_protect_pointer (subst_assign_varlist);
25
++  unwind_protect_pointer (this_shell_builtin);
26
+ 
27
+   /* We have to add the commands this way because they will be run
28
+      in reverse order of adding.  We don't want maybe_set_sigchld_trap ()
29
+--- a/patchlevel.h
30
++++ b/patchlevel.h
31
+@@ -25,6 +25,6 @@
32
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
33
+    looks for to find the patch level (for the sccs version string). */
34
+ 
35
+-#define PATCHLEVEL 11
36
++#define PATCHLEVEL 12
37
+ 
38
+ #endif /* _PATCHLEVEL_H_ */

+ 52
- 0
utils/bash/patches/113-upstream-bash43-013.patch Visa fil

@@ -0,0 +1,52 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-013
6
+
7
+Bug-Reported-by:	<Trond.Endrestol@ximalas.info>
8
+Bug-Reference-ID:	<alpine.BSF.2.03.1404192114310.1973@enterprise.ximalas.info>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00069.html
10
+
11
+Bug-Description:
12
+
13
+Using reverse-i-search when horizontal scrolling is enabled does not redisplay
14
+the entire line containing the successful search results.
15
+
16
+Patch (apply with `patch -p0'):
17
+--- a/lib/readline/display.c
18
++++ b/lib/readline/display.c
19
+@@ -1637,7 +1637,7 @@ update_line (old, new, current_line, oma
20
+   /* If we are changing the number of invisible characters in a line, and
21
+      the spot of first difference is before the end of the invisible chars,
22
+      lendiff needs to be adjusted. */
23
+-  if (current_line == 0 && !_rl_horizontal_scroll_mode &&
24
++  if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
25
+       current_invis_chars != visible_wrap_offset)
26
+     {
27
+       if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
28
+@@ -1825,8 +1825,13 @@ update_line (old, new, current_line, oma
29
+ 	      else
30
+ 		_rl_last_c_pos += bytes_to_insert;
31
+ 
32
++	      /* XXX - we only want to do this if we are at the end of the line
33
++		 so we move there with _rl_move_cursor_relative */
34
+ 	      if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new)))
35
+-		goto clear_rest_of_line;
36
++		{
37
++		  _rl_move_cursor_relative (ne-new, new);
38
++		  goto clear_rest_of_line;
39
++		}
40
+ 	    }
41
+ 	}
42
+       /* Otherwise, print over the existing material. */
43
+--- a/patchlevel.h
44
++++ b/patchlevel.h
45
+@@ -25,6 +25,6 @@
46
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
47
+    looks for to find the patch level (for the sccs version string). */
48
+ 
49
+-#define PATCHLEVEL 12
50
++#define PATCHLEVEL 13
51
+ 
52
+ #endif /* _PATCHLEVEL_H_ */

+ 95
- 0
utils/bash/patches/114-upstream-bash43-014.patch Visa fil

@@ -0,0 +1,95 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-014
6
+
7
+Bug-Reported-by:	Greg Wooledge <wooledg@eeg.ccf.org>
8
+Bug-Reference-ID:	<20140418202123.GB7660@eeg.ccf.org>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/help-bash/2014-04/msg00004.html
10
+
11
+Bug-Description:
12
+
13
+Under certain circumstances, $@ is expanded incorrectly in contexts where
14
+word splitting is not performed.
15
+
16
+Patch (apply with `patch -p0'):
17
+--- a/subst.c
18
++++ b/subst.c
19
+@@ -3248,8 +3248,10 @@ cond_expand_word (w, special)
20
+   if (w->word == 0 || w->word[0] == '\0')
21
+     return ((char *)NULL);
22
+ 
23
++  expand_no_split_dollar_star = 1;
24
+   w->flags |= W_NOSPLIT2;
25
+   l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0);
26
++  expand_no_split_dollar_star = 0;
27
+   if (l)
28
+     {
29
+       if (special == 0)			/* LHS */
30
+@@ -7847,6 +7849,10 @@ param_expand (string, sindex, quoted, ex
31
+ 	 We also want to make sure that splitting is done no matter what --
32
+ 	 according to POSIX.2, this expands to a list of the positional
33
+ 	 parameters no matter what IFS is set to. */
34
++      /* XXX - what to do when in a context where word splitting is not
35
++	 performed? Even when IFS is not the default, posix seems to imply
36
++	 that we behave like unquoted $* ?  Maybe we should use PF_NOSPLIT2
37
++	 here. */
38
+       temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted);
39
+ 
40
+       tflag |= W_DOLLARAT;
41
+@@ -8816,6 +8822,7 @@ finished_with_string:
42
+   else
43
+     {
44
+       char *ifs_chars;
45
++      char *tstring;
46
+ 
47
+       ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL;
48
+ 
49
+@@ -8830,11 +8837,36 @@ finished_with_string:
50
+ 	 regardless of what else has happened to IFS since the expansion. */
51
+       if (split_on_spaces)
52
+ 	list = list_string (istring, " ", 1);	/* XXX quoted == 1? */
53
++      /* If we have $@ (has_dollar_at != 0) and we are in a context where we
54
++	 don't want to split the result (W_NOSPLIT2), and we are not quoted,
55
++	 we have already separated the arguments with the first character of
56
++	 $IFS.  In this case, we want to return a list with a single word
57
++	 with the separator possibly replaced with a space (it's what other
58
++	 shells seem to do).
59
++	 quoted_dollar_at is internal to this function and is set if we are
60
++	 passed an argument that is unquoted (quoted == 0) but we encounter a
61
++	 double-quoted $@ while expanding it. */
62
++      else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2))
63
++	{
64
++	  /* Only split and rejoin if we have to */
65
++	  if (*ifs_chars && *ifs_chars != ' ')
66
++	    {
67
++	      list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
68
++	      tstring = string_list (list);
69
++	    }
70
++	  else
71
++	    tstring = istring;
72
++	  tword = make_bare_word (tstring);
73
++	  if (tstring != istring)
74
++	    free (tstring);
75
++	  goto set_word_flags;
76
++	}
77
+       else if (has_dollar_at && ifs_chars)
78
+ 	list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
79
+       else
80
+ 	{
81
+ 	  tword = make_bare_word (istring);
82
++set_word_flags:
83
+ 	  if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED))
84
+ 	    tword->flags |= W_QUOTED;
85
+ 	  if (word->flags & W_ASSIGNMENT)
86
+--- a/patchlevel.h
87
++++ b/patchlevel.h
88
+@@ -25,6 +25,6 @@
89
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
90
+    looks for to find the patch level (for the sccs version string). */
91
+ 
92
+-#define PATCHLEVEL 13
93
++#define PATCHLEVEL 14
94
+ 
95
+ #endif /* _PATCHLEVEL_H_ */

+ 48
- 0
utils/bash/patches/115-upstream-bash43-015.patch Visa fil

@@ -0,0 +1,48 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-015
6
+
7
+Bug-Reported-by:	Clark Wang <dearvoid@gmail.com>
8
+Bug-Reference-ID:	<CADv8-og2TOSoabXeNVXVGaXN3tEMHnYVq1rwOLe5meaRPSGRig@mail.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00095.html
10
+
11
+Bug-Description:
12
+
13
+When completing directory names, the directory name is dequoted twice.
14
+This causes problems for directories with single and double quotes in
15
+their names.
16
+
17
+Patch (apply with `patch -p0'):
18
+--- a/bashline.c
19
++++ b/bashline.c
20
+@@ -4167,9 +4167,16 @@ bash_directory_completion_matches (text)
21
+   int qc;
22
+ 
23
+   qc = rl_dispatching ? rl_completion_quote_character : 0;  
24
+-  dfn = bash_dequote_filename ((char *)text, qc);
25
++  /* If rl_completion_found_quote != 0, rl_completion_matches will call the
26
++     filename dequoting function, causing the directory name to be dequoted
27
++     twice. */
28
++  if (rl_dispatching && rl_completion_found_quote == 0)
29
++    dfn = bash_dequote_filename ((char *)text, qc);
30
++  else
31
++    dfn = (char *)text;
32
+   m1 = rl_completion_matches (dfn, rl_filename_completion_function);
33
+-  free (dfn);
34
++  if (dfn != text)
35
++    free (dfn);
36
+ 
37
+   if (m1 == 0 || m1[0] == 0)
38
+     return m1;
39
+--- a/patchlevel.h
40
++++ b/patchlevel.h
41
+@@ -25,6 +25,6 @@
42
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
43
+    looks for to find the patch level (for the sccs version string). */
44
+ 
45
+-#define PATCHLEVEL 14
46
++#define PATCHLEVEL 15
47
+ 
48
+ #endif /* _PATCHLEVEL_H_ */

+ 121
- 0
utils/bash/patches/116-upstream-bash43-016.patch Visa fil

@@ -0,0 +1,121 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-016
6
+
7
+Bug-Reported-by:	Pierre Gaston <pierre.gaston@gmail.com>
8
+Bug-Reference-ID:	<CAPSX3sTCD61k1VQLJ5r-LWzEt+e7Xc-fxXmwn2u8EA5gJJej8Q@mail.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00100.html
10
+
11
+Bug-Description:
12
+
13
+An extended glob pattern containing a slash (`/') causes the globbing code
14
+to misinterpret it as a directory separator.
15
+
16
+Patch (apply with `patch -p0'):
17
+--- a/lib/glob/glob.c
18
++++ b/lib/glob/glob.c
19
+@@ -123,6 +123,8 @@ static char **glob_dir_to_array __P((cha
20
+ extern char *glob_patscan __P((char *, char *, int));
21
+ extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int));
22
+ 
23
++extern char *glob_dirscan __P((char *, int));
24
++
25
+ /* Compile `glob_loop.c' for single-byte characters. */
26
+ #define CHAR	unsigned char
27
+ #define INT	int
28
+@@ -187,6 +189,9 @@ extglob_skipname (pat, dname, flags)
29
+   se = pp + strlen (pp) - 1;		/* end of string */
30
+   pe = glob_patscan (pp, se, 0);	/* end of extglob pattern (( */
31
+   /* we should check for invalid extglob pattern here */
32
++  if (pe == 0)
33
++    return 0;
34
++
35
+   /* if pe != se we have more of the pattern at the end of the extglob
36
+      pattern. Check the easy case first ( */
37
+   if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
38
+@@ -1015,7 +1020,7 @@ glob_filename (pathname, flags)
39
+ {
40
+   char **result;
41
+   unsigned int result_size;
42
+-  char *directory_name, *filename, *dname;
43
++  char *directory_name, *filename, *dname, *fn;
44
+   unsigned int directory_len;
45
+   int free_dirname;			/* flag */
46
+   int dflags;
47
+@@ -1031,6 +1036,18 @@ glob_filename (pathname, flags)
48
+ 
49
+   /* Find the filename.  */
50
+   filename = strrchr (pathname, '/');
51
++#if defined (EXTENDED_GLOB)
52
++  if (filename && extended_glob)
53
++    {
54
++      fn = glob_dirscan (pathname, '/');
55
++#if DEBUG_MATCHING
56
++      if (fn != filename)
57
++	fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename);
58
++#endif
59
++      filename = fn;
60
++    }
61
++#endif
62
++
63
+   if (filename == NULL)
64
+     {
65
+       filename = pathname;
66
+--- a/lib/glob/gmisc.c
67
++++ b/lib/glob/gmisc.c
68
+@@ -42,6 +42,8 @@
69
+ #define WLPAREN         L'('
70
+ #define WRPAREN         L')'
71
+ 
72
++extern char *glob_patscan __P((char *, char *, int));
73
++
74
+ /* Return 1 of the first character of WSTRING could match the first
75
+    character of pattern WPAT.  Wide character version. */
76
+ int
77
+@@ -375,3 +377,34 @@ bad_bracket:
78
+ 
79
+   return matlen;
80
+ }
81
++
82
++/* Skip characters in PAT and return the final occurrence of DIRSEP.  This
83
++   is only called when extended_glob is set, so we have to skip over extglob
84
++   patterns x(...) */
85
++char *
86
++glob_dirscan (pat, dirsep)
87
++     char *pat;
88
++     int dirsep;
89
++{
90
++  char *p, *d, *pe, *se;
91
++
92
++  d = pe = se = 0;
93
++  for (p = pat; p && *p; p++)
94
++    {
95
++      if (extglob_pattern_p (p))
96
++	{
97
++	  if (se == 0)
98
++	    se = p + strlen (p) - 1;
99
++	  pe = glob_patscan (p + 2, se, 0);
100
++	  if (pe == 0)
101
++	    continue;
102
++	  else if (*pe == 0)
103
++	    break;
104
++	  p = pe - 1;	/* will do increment above */
105
++	  continue;
106
++	}
107
++      if (*p ==  dirsep)
108
++	d = p;
109
++    }
110
++  return d;
111
++}
112
+--- a/patchlevel.h
113
++++ b/patchlevel.h
114
+@@ -25,6 +25,6 @@
115
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
116
+    looks for to find the patch level (for the sccs version string). */
117
+ 
118
+-#define PATCHLEVEL 15
119
++#define PATCHLEVEL 16
120
+ 
121
+ #endif /* _PATCHLEVEL_H_ */

+ 41
- 0
utils/bash/patches/117-upstream-bash43-017.patch Visa fil

@@ -0,0 +1,41 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-017
6
+
7
+Bug-Reported-by:	Dan Douglas <ormaaj@gmail.com>
8
+Bug-Reference-ID:	<7781746.RhfoTROLxF@smorgbox>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00026.html
10
+
11
+Bug-Description:
12
+
13
+The code that creates local variables should not clear the `invisible'
14
+attribute when returning an existing local variable.  Let the code that
15
+actually assigns a value clear it.
16
+
17
+Patch (apply with `patch -p0'):
18
+--- a/variables.c
19
++++ b/variables.c
20
+@@ -2197,10 +2197,7 @@ make_local_variable (name)
21
+   /* local foo; local foo;  is a no-op. */
22
+   old_var = find_variable (name);
23
+   if (old_var && local_p (old_var) && old_var->context == variable_context)
24
+-    {
25
+-      VUNSETATTR (old_var, att_invisible);	/* XXX */
26
+-      return (old_var);
27
+-    }
28
++    return (old_var);
29
+ 
30
+   was_tmpvar = old_var && tempvar_p (old_var);
31
+   /* If we're making a local variable in a shell function, the temporary env
32
+--- a/patchlevel.h
33
++++ b/patchlevel.h
34
+@@ -25,6 +25,6 @@
35
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
36
+    looks for to find the patch level (for the sccs version string). */
37
+ 
38
+-#define PATCHLEVEL 16
39
++#define PATCHLEVEL 17
40
+ 
41
+ #endif /* _PATCHLEVEL_H_ */

+ 38
- 0
utils/bash/patches/118-upstream-bash43-018.patch Visa fil

@@ -0,0 +1,38 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-018
6
+
7
+Bug-Reported-by:	Geir Hauge <geir.hauge@gmail.com>
8
+Bug-Reference-ID:	<CAO-BiTLOvfPXDypg61jcBausADrxUKJejakV2WTWP26cW0=rgA@mail.gmail.com>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00040.html
10
+
11
+Bug-Description:
12
+
13
+When assigning an array variable using the compound assignment syntax,
14
+but using `declare' with the rhs of the compound assignment quoted, the
15
+shell did not mark the variable as visible after successfully performing
16
+the assignment.
17
+
18
+Patch (apply with `patch -p0'):
19
+--- a/arrayfunc.c
20
++++ b/arrayfunc.c
21
+@@ -179,6 +179,7 @@ bind_array_var_internal (entry, ind, key
22
+     array_insert (array_cell (entry), ind, newval);
23
+   FREE (newval);
24
+ 
25
++  VUNSETATTR (entry, att_invisible);	/* no longer invisible */
26
+   return (entry);
27
+ }
28
+ 
29
+--- a/patchlevel.h
30
++++ b/patchlevel.h
31
+@@ -25,6 +25,6 @@
32
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
33
+    looks for to find the patch level (for the sccs version string). */
34
+ 
35
+-#define PATCHLEVEL 17
36
++#define PATCHLEVEL 18
37
+ 
38
+ #endif /* _PATCHLEVEL_H_ */

+ 75
- 0
utils/bash/patches/119-upstream-bash43-019.patch Visa fil

@@ -0,0 +1,75 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-019
6
+
7
+Bug-Reported-by:	John Lenton
8
+Bug-Reference-ID:
9
+Bug-Reference-URL:	https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1317476
10
+
11
+Bug-Description:
12
+
13
+The -t timeout option to `read' does not work when the -e option is used.
14
+
15
+Patch (apply with `patch -p0'):
16
+
17
+--- a/lib/readline/input.c
18
++++ b/lib/readline/input.c
19
+@@ -534,8 +534,16 @@ rl_getc (stream)
20
+ 	return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
21
+       else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
22
+ 	return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
23
++      /* keyboard-generated signals of interest */
24
+       else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT)
25
+         RL_CHECK_SIGNALS ();
26
++      /* non-keyboard-generated signals of interest */
27
++      else if (_rl_caught_signal == SIGALRM
28
++#if defined (SIGVTALRM)
29
++		|| _rl_caught_signal == SIGVTALRM
30
++#endif
31
++	      )
32
++        RL_CHECK_SIGNALS ();
33
+ 
34
+       if (rl_signal_event_hook)
35
+ 	(*rl_signal_event_hook) ();
36
+--- a/builtins/read.def
37
++++ b/builtins/read.def
38
+@@ -442,7 +442,10 @@ read_builtin (list)
39
+       add_unwind_protect (reset_alarm, (char *)NULL);
40
+ #if defined (READLINE)
41
+       if (edit)
42
+-	add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
43
++	{
44
++	  add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
45
++	  add_unwind_protect (bashline_reset_event_hook, (char *)NULL);
46
++	}
47
+ #endif
48
+       falarm (tmsec, tmusec);
49
+     }
50
+@@ -1021,6 +1024,7 @@ edit_line (p, itext)
51
+ 
52
+   old_attempted_completion_function = rl_attempted_completion_function;
53
+   rl_attempted_completion_function = (rl_completion_func_t *)NULL;
54
++  bashline_set_event_hook ();
55
+   if (itext)
56
+     {
57
+       old_startup_hook = rl_startup_hook;
58
+@@ -1032,6 +1036,7 @@ edit_line (p, itext)
59
+ 
60
+   rl_attempted_completion_function = old_attempted_completion_function;
61
+   old_attempted_completion_function = (rl_completion_func_t *)NULL;
62
++  bashline_reset_event_hook ();
63
+ 
64
+   if (ret == 0)
65
+     return ret;
66
+--- a/patchlevel.h
67
++++ b/patchlevel.h
68
+@@ -25,6 +25,6 @@
69
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
70
+    looks for to find the patch level (for the sccs version string). */
71
+ 
72
+-#define PATCHLEVEL 18
73
++#define PATCHLEVEL 19
74
+ 
75
+ #endif /* _PATCHLEVEL_H_ */

+ 93
- 0
utils/bash/patches/120-upstream-bash43-020.patch Visa fil

@@ -0,0 +1,93 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-020
6
+
7
+Bug-Reported-by:	Jared Yanovich <slovichon@gmail.com>
8
+Bug-Reference-ID:	<20140417073654.GB26875@nightderanger.psc.edu>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00065.html
10
+
11
+Bug-Description:
12
+
13
+When PS2 contains a command substitution, here-documents entered in an
14
+interactive shell can sometimes cause a segmentation fault.
15
+
16
+Patch (apply with `patch -p0'):
17
+
18
+--- a/shell.h
19
++++ b/shell.h
20
+@@ -168,7 +168,8 @@ typedef struct _sh_parser_state_t {
21
+   /* flags state affecting the parser */
22
+   int expand_aliases;
23
+   int echo_input_at_read;
24
+-  
25
++  int need_here_doc;
26
++
27
+ } sh_parser_state_t;
28
+ 
29
+ typedef struct _sh_input_line_state_t {
30
+--- a/parse.y
31
++++ b/parse.y
32
+@@ -2642,7 +2642,7 @@ gather_here_documents ()
33
+   int r;
34
+ 
35
+   r = 0;
36
+-  while (need_here_doc)
37
++  while (need_here_doc > 0)
38
+     {
39
+       parser_state |= PST_HEREDOC;
40
+       make_here_document (redir_stack[r++], line_number);
41
+@@ -6075,6 +6075,7 @@ save_parser_state (ps)
42
+ 
43
+   ps->expand_aliases = expand_aliases;
44
+   ps->echo_input_at_read = echo_input_at_read;
45
++  ps->need_here_doc = need_here_doc;
46
+ 
47
+   ps->token = token;
48
+   ps->token_buffer_size = token_buffer_size;
49
+@@ -6123,6 +6124,7 @@ restore_parser_state (ps)
50
+ 
51
+   expand_aliases = ps->expand_aliases;
52
+   echo_input_at_read = ps->echo_input_at_read;
53
++  need_here_doc = ps->need_here_doc;
54
+ 
55
+   FREE (token);
56
+   token = ps->token;
57
+--- a/y.tab.c
58
++++ b/y.tab.c
59
+@@ -4954,7 +4954,7 @@ gather_here_documents ()
60
+   int r;
61
+ 
62
+   r = 0;
63
+-  while (need_here_doc)
64
++  while (need_here_doc > 0)
65
+     {
66
+       parser_state |= PST_HEREDOC;
67
+       make_here_document (redir_stack[r++], line_number);
68
+@@ -8387,6 +8387,7 @@ save_parser_state (ps)
69
+ 
70
+   ps->expand_aliases = expand_aliases;
71
+   ps->echo_input_at_read = echo_input_at_read;
72
++  ps->need_here_doc = need_here_doc;
73
+ 
74
+   ps->token = token;
75
+   ps->token_buffer_size = token_buffer_size;
76
+@@ -8435,6 +8436,7 @@ restore_parser_state (ps)
77
+ 
78
+   expand_aliases = ps->expand_aliases;
79
+   echo_input_at_read = ps->echo_input_at_read;
80
++  need_here_doc = ps->need_here_doc;
81
+ 
82
+   FREE (token);
83
+   token = ps->token;
84
+--- a/patchlevel.h
85
++++ b/patchlevel.h
86
+@@ -25,6 +25,6 @@
87
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
88
+    looks for to find the patch level (for the sccs version string). */
89
+ 
90
+-#define PATCHLEVEL 19
91
++#define PATCHLEVEL 20
92
+ 
93
+ #endif /* _PATCHLEVEL_H_ */

+ 46
- 0
utils/bash/patches/121-upstream-bash43-021.patch Visa fil

@@ -0,0 +1,46 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-021
6
+
7
+Bug-Reported-by:	Jared Yanovich <slovichon@gmail.com>
8
+Bug-Reference-ID:	<20140625225019.GJ17044@nightderanger.psc.edu>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00070.html
10
+
11
+Bug-Description:
12
+
13
+When the readline `revert-all-at-newline' option is set, pressing newline
14
+when the current line is one retrieved from history results in a double free
15
+and a segmentation fault.
16
+
17
+Patch (apply with `patch -p0'):
18
+
19
+--- a/lib/readline/misc.c
20
++++ b/lib/readline/misc.c
21
+@@ -461,6 +461,7 @@ _rl_revert_all_lines ()
22
+ 	    saved_undo_list = 0;
23
+ 	  /* Set up rl_line_buffer and other variables from history entry */
24
+ 	  rl_replace_from_history (entry, 0);	/* entry->line is now current */
25
++	  entry->data = 0;			/* entry->data is now current undo list */
26
+ 	  /* Undo all changes to this history entry */
27
+ 	  while (rl_undo_list)
28
+ 	    rl_do_undo ();
29
+@@ -468,7 +469,6 @@ _rl_revert_all_lines ()
30
+ 	     the timestamp. */
31
+ 	  FREE (entry->line);
32
+ 	  entry->line = savestring (rl_line_buffer);
33
+-	  entry->data = 0;
34
+ 	}
35
+       entry = previous_history ();
36
+     }
37
+--- a/patchlevel.h
38
++++ b/patchlevel.h
39
+@@ -25,6 +25,6 @@
40
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
41
+    looks for to find the patch level (for the sccs version string). */
42
+ 
43
+-#define PATCHLEVEL 20
44
++#define PATCHLEVEL 21
45
+ 
46
+ #endif /* _PATCHLEVEL_H_ */

+ 47
- 0
utils/bash/patches/122-upstream-bash43-022.patch Visa fil

@@ -0,0 +1,47 @@
1
+			     BASH PATCH REPORT
2
+			     =================
3
+
4
+Bash-Release:	4.3
5
+Patch-ID:	bash43-022
6
+
7
+Bug-Reported-by:	scorp.dev.null@gmail.com
8
+Bug-Reference-ID:	<E1WxXw8-0007iE-Bi@pcm14>
9
+Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html
10
+
11
+Bug-Description:
12
+
13
+Using nested pipelines within loops with the `lastpipe' option set can result
14
+in a segmentation fault.
15
+
16
+Patch (apply with `patch -p0'):
17
+
18
+--- a/execute_cmd.c
19
++++ b/execute_cmd.c
20
+@@ -2413,7 +2413,16 @@ execute_pipeline (command, asynchronous,
21
+ #endif
22
+       lstdin = wait_for (lastpid);
23
+ #if defined (JOB_CONTROL)
24
+-      exec_result = job_exit_status (lastpipe_jid);
25
++      /* If wait_for removes the job from the jobs table, use result of last
26
++	 command as pipeline's exit status as usual.  The jobs list can get
27
++	 frozen and unfrozen at inconvenient times if there are multiple pipelines
28
++	 running simultaneously. */
29
++      if (INVALID_JOB (lastpipe_jid) == 0)
30
++	exec_result = job_exit_status (lastpipe_jid);
31
++      else if (pipefail_opt)
32
++	exec_result = exec_result | lstdin;	/* XXX */
33
++      /* otherwise we use exec_result */
34
++        
35
+ #endif
36
+       unfreeze_jobs_list ();
37
+     }
38
+--- a/patchlevel.h
39
++++ b/patchlevel.h
40
+@@ -25,6 +25,6 @@
41
+    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
42
+    looks for to find the patch level (for the sccs version string). */
43
+ 
44
+-#define PATCHLEVEL 21
45
++#define PATCHLEVEL 22
46
+ 
47
+ #endif /* _PATCHLEVEL_H_ */