]>
Commit | Line | Data |
---|---|---|
4e9fe84f JB |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 3.0 | |
5 | Patch-ID: bash30-010 | |
6 | ||
7 | Bug-Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org> | |
8 | Bug-Reference-ID: <E1Bo8Sq-0004u5-00@bouh> | |
9 | Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=261142 | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | When trying to auto-complete ~/../``/, I just get: | |
14 | malloc: bashline.c:1340: assertion botched | |
15 | free: start and end chunk sizes differ | |
16 | last command: kill -9 %2 | |
17 | Stopping myself... | |
18 | ||
19 | ||
20 | Patch: | |
21 | ||
22 | *** ../bash-3.0/bashline.c Mon Jul 5 23:22:12 2004 | |
23 | --- bashline.c Thu Sep 2 16:00:12 2004 | |
24 | *************** | |
25 | *** 101,104 **** | |
26 | --- 101,105 ---- | |
27 | ||
28 | /* Helper functions for Readline. */ | |
29 | + static int bash_directory_expansion __P((char **)); | |
30 | static int bash_directory_completion_hook __P((char **)); | |
31 | static int filename_completion_ignore __P((char **)); | |
32 | *************** | |
33 | *** 293,297 **** | |
34 | at = strchr (rl_completer_word_break_characters, '@'); | |
35 | if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0)) | |
36 | ! return; | |
37 | ||
38 | /* We have something to do. Do it. */ | |
39 | --- 294,298 ---- | |
40 | at = strchr (rl_completer_word_break_characters, '@'); | |
41 | if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0)) | |
42 | ! return old_value; | |
43 | ||
44 | /* We have something to do. Do it. */ | |
45 | *************** | |
46 | *** 1407,1414 **** | |
47 | if (*hint_text == '~') | |
48 | { | |
49 | ! int l, tl, vl; | |
50 | vl = strlen (val); | |
51 | tl = strlen (hint_text); | |
52 | l = vl - hint_len; /* # of chars added */ | |
53 | temp = (char *)xmalloc (l + 2 + tl); | |
54 | strcpy (temp, hint_text); | |
55 | --- 1408,1424 ---- | |
56 | if (*hint_text == '~') | |
57 | { | |
58 | ! int l, tl, vl, dl; | |
59 | ! char *rd; | |
60 | vl = strlen (val); | |
61 | tl = strlen (hint_text); | |
62 | + #if 0 | |
63 | l = vl - hint_len; /* # of chars added */ | |
64 | + #else | |
65 | + rd = savestring (filename_hint); | |
66 | + bash_directory_expansion (&rd); | |
67 | + dl = strlen (rd); | |
68 | + l = vl - dl; /* # of chars added */ | |
69 | + free (rd); | |
70 | + #endif | |
71 | temp = (char *)xmalloc (l + 2 + tl); | |
72 | strcpy (temp, hint_text); | |
73 | *************** | |
74 | *** 2188,2191 **** | |
75 | --- 2198,2222 ---- | |
76 | } | |
77 | ||
78 | + /* Simulate the expansions that will be performed by | |
79 | + rl_filename_completion_function. This must be called with the address of | |
80 | + a pointer to malloc'd memory. */ | |
81 | + static int | |
82 | + bash_directory_expansion (dirname) | |
83 | + char **dirname; | |
84 | + { | |
85 | + char *d; | |
86 | + | |
87 | + d = savestring (*dirname); | |
88 | + | |
89 | + if (rl_directory_rewrite_hook) | |
90 | + (*rl_directory_rewrite_hook) (&d); | |
91 | + | |
92 | + if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&d)) | |
93 | + { | |
94 | + free (*dirname); | |
95 | + *dirname = d; | |
96 | + } | |
97 | + } | |
98 | + | |
99 | /* Handle symbolic link references and other directory name | |
100 | expansions while hacking completion. */ | |
101 | ||
102 | *** ../bash-3.0/patchlevel.h Wed Aug 22 08:05:39 2001 | |
103 | --- patchlevel.h Thu Sep 2 15:04:32 2004 | |
104 | *************** | |
105 | *** 26,30 **** | |
106 | looks for to find the patch level (for the sccs version string). */ | |
107 | ||
108 | ! #define PATCHLEVEL 9 | |
109 | ||
110 | #endif /* _PATCHLEVEL_H_ */ | |
111 | --- 26,30 ---- | |
112 | looks for to find the patch level (for the sccs version string). */ | |
113 | ||
114 | ! #define PATCHLEVEL 10 | |
115 | ||
116 | #endif /* _PATCHLEVEL_H_ */ |