summaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>2002-08-21 17:07:26 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2002-08-21 17:07:26 +0000
commitd873d8274339cd0a352eb4cf287f6b04eeb08c1d (patch)
treea773688e399f9509b6a92059e40562ffa02b9c37 /gcc/cppinit.c
parentb462d4abc6d0857ed7df3467b98b5df12e9d6329 (diff)
downloadgcc-d873d8274339cd0a352eb4cf287f6b04eeb08c1d.tar.gz
* cppinit.c (remove_dup_nonsys_dirs): Fix warning and return value.
From-SVN: r56493
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index bdee5a66b31..99dd9490646 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -303,12 +303,14 @@ remove_dup_nonsys_dirs (pfile, head_ptr, end)
struct search_path **head_ptr;
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)
{
if (cur->sysp)
{
+ sysdir = 1;
for (other = *head_ptr, prev = NULL;
other != end;
other = other ? other->next : *head_ptr)
@@ -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;
}