]> gcc.gnu.org Git - gcc.git/commitdiff
* cppinit.c (remove_dup_nonsys_dirs): Fix warning and return value.
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Wed, 21 Aug 2002 17:07:26 +0000 (17:07 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Wed, 21 Aug 2002 17:07:26 +0000 (17:07 +0000)
From-SVN: r56493

gcc/ChangeLog
gcc/cppinit.c

index 2424aa26badf7164f88049a4dff1161c99ee1fe1..670b10d3eaad6eea9eca7c95f97da5748fe64bab 100644 (file)
@@ -1,3 +1,7 @@
+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>
 
        * c-decl.c (grokdeclarator): Make invalid combinations with long,
index bdee5a66b31ec30043c5b82e167a7c49f09657d2..99dd9490646b97ab4fbd0b47e1f9227f45132fab 100644 (file)
@@ -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;
 }
 
This page took 0.089917 seconds and 5 git commands to generate.