summaryrefslogtreecommitdiff
path: root/debian/patches/bug30612.patch
blob: 673be1df98c041f4efc40c0de9e5f8d51973b40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Description: Fix Savannah bug #30612: handling of archive references with >1 object
Source: http://cvs.savannah.gnu.org/viewvc/make/make/read.c?r1=1.193&r2=1.194
Bug: https://savannah.gnu.org/bugs/?30612
Index: make/read.c
===================================================================
--- make.orig/read.c	2013-05-03 18:55:48.713768282 +0400
+++ make/read.c	2013-05-03 18:55:48.910846433 +0400
@@ -3033,7 +3033,7 @@
             {
               /* This looks like the first element in an open archive group.
                  A valid group MUST have ')' as the last character.  */
-              const char *e = p + nlen;
+              const char *e = p;
               do
                 {
                   e = next_token (e);
@@ -3089,19 +3089,19 @@
          Go to the next item in the string.  */
       if (flags & PARSEFS_NOGLOB)
         {
-          NEWELT (concat (2, prefix, tp));
+          NEWELT (concat (2, prefix, tmpbuf));
           continue;
         }
 
       /* If we get here we know we're doing glob expansion.
          TP is a string in tmpbuf.  NLEN is no longer used.
          We may need to do more work: after this NAME will be set.  */
-      name = tp;
+      name = tmpbuf;
 
       /* Expand tilde if applicable.  */
-      if (tp[0] == '~')
+      if (tmpbuf[0] == '~')
 	{
-	  tildep = tilde_expand (tp);
+	  tildep = tilde_expand (tmpbuf);
 	  if (tildep != 0)
             name = tildep;
 	}
@@ -3157,7 +3157,10 @@
             else
               {
                 /* We got a chain of items.  Attach them.  */
-                (*newp)->next = found;
+                if (*newp)
+                  (*newp)->next = found;
+                else
+                  *newp = found;
 
                 /* Find and set the new end.  Massage names if necessary.  */
                 while (1)