--- gnash-0.8.6.orig/libbase/rc.cpp	2009-09-13 19:22:16.000000000 -0400
+++ gnash-0.8.6/libbase/rc.cpp	2009-12-10 11:49:46.065126344 -0500
@@ -38,6 +38,7 @@
 #include <cstdlib> // getenv
 #include <string>
 #include <vector>
+#include <algorithm>
 #include <iostream>
 #include <fstream>
 #include <sstream>
@@ -164,18 +165,34 @@
     }
 
     // Check the GNASHRC environment variable
-    // TODO: keep note of the already-parsed files
-    //       to avoid parsign multiple times ?
-    //       (would mess up user-reguested order)
+    // Parse each file only once
     char *gnashrc = std::getenv("GNASHRC");
     if (gnashrc)
     {
         std::string paths(gnashrc);
-
         Tok t(paths, Sep(":"));
 
+        PathList l;
+        //std::map<PathList::value_type, PathList::iterator> m;
+
         for (Tok::iterator i = t.begin(), e = t.end(); i != e; ++i)
         {
+            // This algorithm would be less expensive if l were an actual list.
+            //std::map<PathList::value_type, PathList::iterator>::iterator j =
+            //    m.find(*i);
+            //if (j != m.end())
+            //    l.erase((*j).second);
+            //m[*i] = l.insert(l.end(), *i);
+
+            // We take advantage of the fact that std::remove places "removed"
+            // elements at the end of the list.
+            if (std::remove(l.begin(), l.end(), *i) != l.end()) {
+                l.push_back(*i);
+            }
+        }
+
+        for (PathList::const_iterator i = l.begin(), e = l.end(); i != e; ++i)
+        {
             parseFile(*i);
         }
     }
