summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-03-13 05:45:44 +0000
committerRoland McGrath <roland@redhat.com>1995-03-13 05:45:44 +0000
commitcbfc50cb518db3902fc7f74d3b5840c7a5f4a9fc (patch)
tree5befbab2532c929e2356e0b9e13225e24c6a6a23
parentdeb7cced6e6e4eab5ac9b80364838eaf0171a0d4 (diff)
downloadgunmake-cbfc50cb518db3902fc7f74d3b5840c7a5f4a9fc.tar.gz
(parse_file_seq): Rearranged `l(a b)' -> `l(a) l(b)' loop to not
skip the elt immediately preceding `l(...'.
-rw-r--r--read.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/read.c b/read.c
index 5808044..5c49b8c 100644
--- 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