115-upstream-bash43-015.patch (1510B)
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_ */