OSDN Git Service

* cppinit.c (remove_dup_nonsys_dirs): Fix warning and return value.
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2002 17:07:26 +0000 (17:07 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Aug 2002 17:07:26 +0000 (17:07 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56493 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cppinit.c

index 2424aa2..670b10d 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 bdee5a6..99dd949 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;
 }