gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/libbase URL.cpp


From: Vitaly Alexeev
Subject: [Gnash-commit] gnash/libbase URL.cpp
Date: Mon, 11 Sep 2006 14:52:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Vitaly Alexeev <alexeev>        06/09/11 14:52:48

Modified files:
        libbase        : URL.cpp 

Log message:
        parsing of win32 path

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/URL.cpp?cvsroot=gnash&r1=1.22&r2=1.23

Patches:
Index: URL.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/URL.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- URL.cpp     11 Sep 2006 14:24:11 -0000      1.22
+++ URL.cpp     11 Sep 2006 14:52:48 -0000      1.23
@@ -119,10 +119,7 @@
 
        split_querystring_from_path();
 
-#if ! (defined(_WIN32) || defined(WIN32))
-       assert ( _path[0] == '/');
        normalize_path(_path);
-#endif
 }
 
 /*public*/
@@ -182,6 +179,10 @@
 URL::normalize_path(string& path)
 {
 
+#if defined(_WIN32) || defined(WIN32) 
+       return;
+#endif
+
        assert(path[0] == '/');
 
 
@@ -295,10 +296,19 @@
                string basedir = baseurl._path.substr(0,
                        baseurl._path.find_last_of("/")+1);
 
+               // for WIN32
+               if (basedir == "")
+               {
+                       basedir = baseurl._path.substr(0,
+                               baseurl._path.find_last_of("\\")+1);
+               }
+
 //fprintf(stderr, "basedir=%s\n", basedir.c_str());
 
-               assert(basedir[0] == '/');
-               assert(*(basedir.rbegin()) == '/');
+               assert(basedir[0] == '/'
+                       || basedir[1] == ':');  // for WIN32
+               assert(*(basedir.rbegin()) == '/' 
+                       || *(basedir.rbegin()) == '\\');        // for WIN32
 
                string::size_type lpos =  basedir.size()-1;
                for (int i=0; i<dirsback; ++i)




reply via email to

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