]> git.ipfire.org Git - thirdparty/make.git/commitdiff
(parse_file_seq): Rearranged `l(a b)' -> `l(a) l(b)' loop to not
authorRoland McGrath <roland@redhat.com>
Mon, 13 Mar 1995 05:45:44 +0000 (05:45 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 13 Mar 1995 05:45:44 +0000 (05:45 +0000)
skip the elt immediately preceding `l(...'.

read.c

diff --git a/read.c b/read.c
index 580804439e95e2c35aa5b4d3d87459792536676a..5c49b8ca838002da67f8b48c3b6c7ab6bf27ade7 100644 (file)
--- a/read.c
+++ b/read.c
@@ -1582,7 +1582,9 @@ parse_file_seq (stringp, stopchar, size, strip)
      an elt further down the chain (i.e., previous in the file list)
      with an unmatched `(' (e.g., "lib(mem").  */
 
-  for (new1 = new, lastnew1 = 0; new1 != 0; lastnew1 = new1, new1 = new1->next)
+  new1 = new;
+  lastnew1 = 0;
+  while (new1 != 0)
     if (new1->name[0] != '('   /* Don't catch "(%)" and suchlike.  */
        && new1->name[strlen (new1->name) - 1] == ')'
        && index (new1->name, '(') == 0)
@@ -1663,14 +1665,21 @@ parse_file_seq (stringp, stopchar, size, strip)
                name = concat (libname, new1->name, ")");
                free (new1->name);
                new1->name = name;
+               lastnew1 = new1;
                new1 = new1->next;
              }
-
-           if (new1 == 0)
-             /* We might have slurped up the whole list,
-                and continuing the loop would dereference NEW1.  */
-             break;
          }
+       else
+         {
+           /* No frobnication happening.  Just step down the list.  */
+           lastnew1 = new1;
+           new1 = new1->next;
+         }
+      }
+    else
+      {
+       lastnew1 = new1;
+       new1 = new1->next;
       }
 
 #endif