|
1 This patch is taken from: |
|
2 http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.193&r2=1.194 |
|
3 |
|
4 Fix various errors parsing archives with multiple objects in the parenthesis, |
|
5 as well as wildcards. Fixes Savannah bug #30612. |
|
6 |
|
7 https://savannah.gnu.org/bugs/?30612 |
|
8 |
|
9 Second patch is a followup for that bug as well: |
|
10 http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.200&r2=1.201 |
|
11 |
|
12 --- a/read.c 2010/07/13 01:20:42 1.193 |
|
13 +++ b/read.c 2010/08/14 02:50:14 1.194 |
|
14 @@ -3028,7 +3028,7 @@ |
|
15 { |
|
16 /* This looks like the first element in an open archive group. |
|
17 A valid group MUST have ')' as the last character. */ |
|
18 - const char *e = p + nlen; |
|
19 + const char *e = p; |
|
20 do |
|
21 { |
|
22 e = next_token (e); |
|
23 @@ -3084,19 +3084,19 @@ |
|
24 Go to the next item in the string. */ |
|
25 if (flags & PARSEFS_NOGLOB) |
|
26 { |
|
27 - NEWELT (concat (2, prefix, tp)); |
|
28 + NEWELT (concat (2, prefix, tmpbuf)); |
|
29 continue; |
|
30 } |
|
31 |
|
32 /* If we get here we know we're doing glob expansion. |
|
33 TP is a string in tmpbuf. NLEN is no longer used. |
|
34 We may need to do more work: after this NAME will be set. */ |
|
35 - name = tp; |
|
36 + name = tmpbuf; |
|
37 |
|
38 /* Expand tilde if applicable. */ |
|
39 - if (tp[0] == '~') |
|
40 + if (tmpbuf[0] == '~') |
|
41 { |
|
42 - tildep = tilde_expand (tp); |
|
43 + tildep = tilde_expand (tmpbuf); |
|
44 if (tildep != 0) |
|
45 name = tildep; |
|
46 } |
|
47 @@ -3152,7 +3152,10 @@ |
|
48 else |
|
49 { |
|
50 /* We got a chain of items. Attach them. */ |
|
51 - (*newp)->next = found; |
|
52 + if (*newp) |
|
53 + (*newp)->next = found; |
|
54 + else |
|
55 + *newp = found; |
|
56 |
|
57 /* Find and set the new end. Massage names if necessary. */ |
|
58 while (1) |
|
59 |
|
60 --- a/read.c 2011/05/07 14:36:12 1.200 |
|
61 +++ b/read.c 2011/06/12 16:22:04 1.201 |
|
62 @@ -3044,16 +3044,16 @@ |
|
63 nlen -= (n + 1) - tp; |
|
64 tp = n + 1; |
|
65 |
|
66 - /* If we have just "lib(", part of something like |
|
67 - "lib( a b)", go to the next item. */ |
|
68 - if (! nlen) |
|
69 - continue; |
|
70 - |
|
71 /* We can stop looking now. */ |
|
72 break; |
|
73 } |
|
74 } |
|
75 while (*e != '\0'); |
|
76 + |
|
77 + /* If we have just "lib(", part of something like "lib( a b)", |
|
78 + go to the next item. */ |
|
79 + if (! nlen) |
|
80 + continue; |
|
81 } |
|
82 } |
|
83 |