gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog plugin/plugin.cpp


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog plugin/plugin.cpp
Date: Wed, 09 Aug 2006 14:01:26 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     06/08/09 14:01:26

Modified files:
        .              : ChangeLog 
        plugin         : plugin.cpp 

Log message:
        Revise URL parsing to work for a single option=value pair.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.611&r2=1.612
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.cpp?cvsroot=gnash&r1=1.37&r2=1.38

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.611
retrieving revision 1.612
diff -u -b -r1.611 -r1.612
--- ChangeLog   9 Aug 2006 12:37:20 -0000       1.611
+++ ChangeLog   9 Aug 2006 14:01:26 -0000       1.612
@@ -1,5 +1,10 @@
 2006-08-09 Bastiaan Jacques <address@hidden>
 
+       * plugin/plugin.cpp: Revise URL parsing to work for a single
+       option=value pair.
+
+2006-08-09 Bastiaan Jacques <address@hidden>
+
        * plugin/plugin.cpp: Don't abort on URL arguments without a name;
        merely ignore them (bug #17161). 
 

Index: plugin/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- plugin/plugin.cpp   9 Aug 2006 12:37:21 -0000       1.37
+++ plugin/plugin.cpp   9 Aug 2006 14:01:26 -0000       1.38
@@ -532,24 +532,29 @@
     
     dbglogfile << __FUNCTION__ << ": The full URL is " << url << endl;
     while (opts.size() > 0) {
-       start = 0;
-       eq = opts.find("=", 0);
+       start = 0; // TODO: An empty name seems useless to me. If this is 
+                  //       indeed the case, we should set `start' to one.
+
+       eq = opts.find("=", start);
+       if (eq == string::npos) {
+           dbglogfile << "INFO: Ignoring URL appendix without name." << endl;
+           goto process;
+       } 
+
        if (opts[0] == '&') {
+           // A (technically invalid) URL like movie.swf?&option=value.
            start++;
        }
+
        end = opts.find("&", start);
-       if (eq == string::npos) {
-           eq = opts.size();
-       }
-       // Some URLs we can't parse for odd reasons, so this prevents
-       // Firefox from crashing in those cases.
        if (end == string::npos) {
-           dbglogfile << "INFO: Ignoring URL appendix without name." << endl;
-           goto process;
-       } else {
+           // We have only one name=value pair remaining.
+           end = opts.size();
+       }
+       
            name = opts.substr(start, eq);
            value = opts.substr(eq+1, end-eq-1);
-       }
+       
        if (dumpopts) {
            dbglogfile << __FUNCTION__ << "Option " << name << " = "
                       << value << endl;




reply via email to

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