commit bash-20051123 snapshot
[platform/upstream/bash.git] / vi-glob-tilde.patch
1 *** ../bash-3.0/bashline.c      Mon Jul  5 23:22:12 2004
2 --- bashline.c  Thu Sep  2 16:00:12 2004
3 ***************
4 *** 2514,2518 ****
5     static int ind;
6     int glen;
7 !   char *ret;
8   
9     if (state == 0)
10 --- 2545,2549 ----
11     static int ind;
12     int glen;
13 !   char *ret, *ttext;
14   
15     if (state == 0)
16 ***************
17 *** 2524,2538 ****
18         FREE (globtext);
19   
20         if (rl_explicit_arg)
21         {
22 !         globorig = savestring (text);
23 !         glen = strlen (text);
24           globtext = (char *)xmalloc (glen + 2);
25 !         strcpy (globtext, text);
26           globtext[glen] = '*';
27           globtext[glen+1] = '\0';
28         }
29         else
30 !         globtext = globorig = savestring (text);
31   
32         matches = shell_glob_filename (globtext);
33 --- 2555,2574 ----
34         FREE (globtext);
35   
36 +       ttext = bash_tilde_expand (text, 0);
37
38         if (rl_explicit_arg)
39         {
40 !         globorig = savestring (ttext);
41 !         glen = strlen (ttext);
42           globtext = (char *)xmalloc (glen + 2);
43 !         strcpy (globtext, ttext);
44           globtext[glen] = '*';
45           globtext[glen+1] = '\0';
46         }
47         else
48 !         globtext = globorig = savestring (ttext);
49
50 !       if (ttext != text)
51 !       free (ttext);
52   
53         matches = shell_glob_filename (globtext);