gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libbase/rc.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/rc.cpp
Date: Fri, 25 Apr 2008 18:14:04 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/25 18:14:04

Modified files:
        .              : ChangeLog 
        libbase        : rc.cpp 

Log message:
        (loadFiles): allow GNASHRC env variable to be
        a comma-separate list of rcfiles to parse.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6396&r2=1.6397
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.66&r2=1.67

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6396
retrieving revision 1.6397
diff -u -b -r1.6396 -r1.6397
--- ChangeLog   25 Apr 2008 15:28:52 -0000      1.6396
+++ ChangeLog   25 Apr 2008 18:14:03 -0000      1.6397
@@ -1,3 +1,8 @@
+2008-04-25 Sandro Santilli <address@hidden>
+
+       * libbase/rc.cpp (loadFiles): allow GNASHRC env variable to be
+         a comma-separate list of rcfiles to parse.
+
 2008-04-25 Benjamin Wolsey <address@hidden>
 
        * server/asobj/Stage.{cpp,h}: register ASnative methods separately,

Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- libbase/rc.cpp      24 Mar 2008 21:46:47 -0000      1.66
+++ libbase/rc.cpp      25 Apr 2008 18:14:04 -0000      1.67
@@ -43,6 +43,8 @@
 #include <iostream>
 #include <fstream>
 
+#include <boost/tokenizer.hpp>
+
 #ifndef DEFAULT_STREAMS_TIMEOUT
 // TODO: add a ./configure switch to set this
 # define DEFAULT_STREAMS_TIMEOUT 10
@@ -145,9 +147,18 @@
 
     // Check the GNASHRC environment variable
     char *gnashrc = getenv("GNASHRC");
-    if (gnashrc) {
-        loadfile = gnashrc;
-        parseFile(loadfile);
+    if (gnashrc)
+    {
+       std::string paths(gnashrc);
+
+       typedef boost::char_separator<char> Sep;
+       typedef boost::tokenizer< Sep > Tok;
+       Tok t(paths, Sep(":"));
+
+        for(Tok::iterator i=t.begin(), e=t.end(); i!=e; ++i)
+       {
+               parseFile(*i);
+       }
     }
 }
 
@@ -338,12 +349,16 @@
         return false;
     }
     
-    if (stat(filespec.c_str(), &stats) != 0) return false;
+    if (stat(filespec.c_str(), &stats) != 0)
+    {
+        cerr << "RcInitFile::parseFile: couldn't open file: " << filespec << 
endl;
+        return false;
+    }
 
     in.open(filespec.c_str());
     
     if (!in) {
-            cerr << "Couldn't open file: " << filespec << endl;
+            cerr << "RcInitFile::parseFile: couldn't open file: " << filespec 
<< endl;
             return false;
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]