]> git.saurik.com Git - wxWidgets.git/commitdiff
small bug fix for composite options
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 5 Jan 2000 02:46:45 +0000 (02:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 5 Jan 2000 02:46:45 +0000 (02:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cmdline.cpp

index f42ca0f098d1327f0637e93c65be426d2f9d69bd..3831fcf595e5b19035052ec3d76695cad6964cf6 100644 (file)
@@ -521,7 +521,7 @@ int wxCmdLineParser::Parse()
                 }
                 while ( optInd == wxNOT_FOUND );
 
-                if ( (len > 0) && (len != name.length()) )
+                if ( (optInd != wxNOT_FOUND) && (len != name.length()) )
                 {
                     // our option is only part of this argument, there is
                     // something else in it - it is either the value of this
@@ -532,9 +532,10 @@ int wxCmdLineParser::Parse()
                         // pretend that all the rest of the argument is the
                         // next argument, in fact
                         wxString arg2 = arg[0u];
-                        arg2 += name.Mid(len);
+                        arg2 += name.Mid(len + 1); // compensates extra --
 
                         m_data->m_arguments.Insert(arg2, n + 1);
+                        count++;
                     }
                     //else: it's our value, we'll deal with it below
                 }