1 *** ../bash-3.0/bashline.c Mon Jul 5 23:22:12 2004
2 --- bashline.c Thu Sep 2 16:00:12 2004
7 /* Helper functions for Readline. */
8 + static int bash_directory_expansion __P((char **));
9 static int bash_directory_completion_hook __P((char **));
10 static int filename_completion_ignore __P((char **));
13 at = strchr (rl_completer_word_break_characters, '@');
14 if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0))
17 /* We have something to do. Do it. */
19 at = strchr (rl_completer_word_break_characters, '@');
20 if ((at == 0 && on_or_off == 0) || (at != 0 && on_or_off != 0))
23 /* We have something to do. Do it. */
26 if (*hint_text == '~')
30 tl = strlen (hint_text);
31 l = vl - hint_len; /* # of chars added */
32 temp = (char *)xmalloc (l + 2 + tl);
33 strcpy (temp, hint_text);
35 if (*hint_text == '~')
40 tl = strlen (hint_text);
42 l = vl - hint_len; /* # of chars added */
44 + rd = savestring (filename_hint);
45 + bash_directory_expansion (&rd);
47 + l = vl - dl; /* # of chars added */
50 temp = (char *)xmalloc (l + 2 + tl);
51 strcpy (temp, hint_text);
57 + /* Simulate the expansions that will be performed by
58 + rl_filename_completion_function. This must be called with the address of
59 + a pointer to malloc'd memory. */
61 + bash_directory_expansion (dirname)
66 + d = savestring (*dirname);
68 + if (rl_directory_rewrite_hook)
69 + (*rl_directory_rewrite_hook) (&d);
71 + if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&d))
78 /* Handle symbolic link references and other directory name
79 expansions while hacking completion. */
99 ! globorig = savestring (text);
100 ! glen = strlen (text);
101 globtext = (char *)xmalloc (glen + 2);
102 ! strcpy (globtext, text);
103 globtext[glen] = '*';
104 globtext[glen+1] = '\0';
107 ! globtext = globorig = savestring (text);
109 matches = shell_glob_filename (globtext);
113 + ttext = bash_tilde_expand (text, 0);
117 ! globorig = savestring (ttext);
118 ! glen = strlen (ttext);
119 globtext = (char *)xmalloc (glen + 2);
120 ! strcpy (globtext, ttext);
121 globtext[glen] = '*';
122 globtext[glen+1] = '\0';
125 ! globtext = globorig = savestring (ttext);
130 matches = shell_glob_filename (globtext);