make-3.82-archives-many-objs.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. http://bugs.gentoo.org/334889
  2. https://savannah.gnu.org/bugs/?30612
  3. revision 1.194
  4. date: 2010-08-13 22:50:14 -0400; author: psmith; state: Exp; lines: +9 -6; commitid: 4UaslPqQHZTs5wKu;
  5. - Fix Savannah bug #30612: handling of archive references with >1 object
  6. Index: read.c
  7. ===================================================================
  8. RCS file: /sources/make/make/read.c,v
  9. retrieving revision 1.193
  10. retrieving revision 1.194
  11. diff -u -p -r1.193 -r1.194
  12. --- read.c 13 Jul 2010 01:20:42 -0000 1.193
  13. +++ read.c 14 Aug 2010 02:50:14 -0000 1.194
  14. @@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned
  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 @@ parse_file_seq (char **stringp, unsigned
  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. /* If we get here we know we're doing glob expansion.
  32. TP is a string in tmpbuf. NLEN is no longer used.
  33. We may need to do more work: after this NAME will be set. */
  34. - name = tp;
  35. + name = tmpbuf;
  36. /* Expand tilde if applicable. */
  37. - if (tp[0] == '~')
  38. + if (tmpbuf[0] == '~')
  39. {
  40. - tildep = tilde_expand (tp);
  41. + tildep = tilde_expand (tmpbuf);
  42. if (tildep != 0)
  43. name = tildep;
  44. }
  45. @@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned
  46. else
  47. {
  48. /* We got a chain of items. Attach them. */
  49. - (*newp)->next = found;
  50. + if (*newp)
  51. + (*newp)->next = found;
  52. + else
  53. + *newp = found;
  54. /* Find and set the new end. Massage names if necessary. */
  55. while (1)