15856019 Archive library support broken in gmake 3.82
authorMike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 14 Nov 2012 12:02:58 -0800
changeset 1050 dd6b3aa7a925
parent 1049 9044ed4c5da9
child 1051 88181893f51e
15856019 Archive library support broken in gmake 3.82
components/make/patches/30612.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/make/patches/30612.patch	Wed Nov 14 12:02:58 2012 -0800
@@ -0,0 +1,83 @@
+This patch is taken from:
+http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.193&r2=1.194
+
+Fix various errors parsing archives with multiple objects in the parenthesis,
+as well as wildcards. Fixes Savannah bug #30612.
+
+https://savannah.gnu.org/bugs/?30612
+
+Second patch is a followup for that bug as well:
+http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.200&r2=1.201
+
+--- a/read.c	2010/07/13 01:20:42	1.193
++++ b/read.c	2010/08/14 02:50:14	1.194
[email protected]@ -3028,7 +3028,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);
[email protected]@ -3084,19 +3084,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;
+ 	}
[email protected]@ -3152,7 +3152,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)
+
+--- a/read.c	2011/05/07 14:36:12	1.200
++++ b/read.c	2011/06/12 16:22:04	1.201
[email protected]@ -3044,16 +3044,16 @@
+                       nlen -= (n + 1) - tp;
+                       tp = n + 1;
+ 
+-                      /* If we have just "lib(", part of something like
+-                         "lib( a b)", go to the next item.  */
+-                      if (! nlen)
+-                        continue;
+-
+                       /* We can stop looking now.  */
+                       break;
+                     }
+                 }
+               while (*e != '\0');
++
++              /* If we have just "lib(", part of something like "lib( a b)",
++                 go to the next item.  */
++              if (! nlen)
++                continue;
+             }
+         }
+