Commit d873d827 by John David Anglin Committed by John David Anglin

* cppinit.c (remove_dup_nonsys_dirs): Fix warning and return value.

From-SVN: r56493
parent b462d4ab
2002-08-21 John David Anglin <dave@hiauly1.hia.nrc.ca>
* cppinit.c (remove_dup_nonsys_dirs): Fix warning and return value.
2002-08-21 Joseph S. Myers <jsm@polyomino.org.uk> 2002-08-21 Joseph S. Myers <jsm@polyomino.org.uk>
* c-decl.c (grokdeclarator): Make invalid combinations with long, * c-decl.c (grokdeclarator): Make invalid combinations with long,
......
...@@ -303,12 +303,14 @@ remove_dup_nonsys_dirs (pfile, head_ptr, end) ...@@ -303,12 +303,14 @@ remove_dup_nonsys_dirs (pfile, head_ptr, end)
struct search_path **head_ptr; struct search_path **head_ptr;
struct search_path *end; struct search_path *end;
{ {
struct search_path *prev, *cur, *other; int sysdir = 0;
struct search_path *prev = NULL, *cur, *other;
for (cur = *head_ptr; cur; cur = cur->next) for (cur = *head_ptr; cur; cur = cur->next)
{ {
if (cur->sysp) if (cur->sysp)
{ {
sysdir = 1;
for (other = *head_ptr, prev = NULL; for (other = *head_ptr, prev = NULL;
other != end; other != end;
other = other ? other->next : *head_ptr) other = other ? other->next : *head_ptr)
...@@ -327,6 +329,10 @@ remove_dup_nonsys_dirs (pfile, head_ptr, end) ...@@ -327,6 +329,10 @@ remove_dup_nonsys_dirs (pfile, head_ptr, end)
} }
} }
if (!sysdir)
for (cur = *head_ptr; cur != end; cur = cur->next)
prev = cur;
return prev; return prev;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment