From cbfc50cb518db3902fc7f74d3b5840c7a5f4a9fc Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 13 Mar 1995 05:45:44 +0000 Subject: (parse_file_seq): Rearranged `l(a b)' -> `l(a) l(b)' loop to not skip the elt immediately preceding `l(...'. --- read.c | 21 +++++++++++++++------ 1 file 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 -- cgit v1.2.3