• R/O
  • HTTP
  • SSH
  • HTTPS

MUtilities: 提交

MUtilities development repository


Commit MetaInfo

修订版415d385f86d8e41309936d0bd7a1f30432787dc5 (tree)
时间2015-10-17 21:01:42
作者LoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

Fixed MUtils::OS::arguments() function. Regression in 44add70b7ca0c549f442981501b71439d4372aaf.

更改概述

差异

--- a/src/OSSupport_Win32.cpp
+++ b/src/OSSupport_Win32.cpp
@@ -119,20 +119,24 @@ const MUtils::OS::ArgumentMap &MUtils::OS::arguments(void)
119119 }
120120
121121 g_arguments_list.reset(new ArgumentMap());
122- int nArgs = 0;
123122 const QStringList argList = crack_command_line();
124123
125- if(argList.count() > 1)
124+ if(!argList.isEmpty())
126125 {
127126 const QString argPrefix = QLatin1String("--");
128- const QChar separator = QLatin1Char('=');
127+ const QChar separator = QLatin1Char('=');
129128
130- for(int i = 1; i < nArgs; i++)
129+ bool firstToken = true;
130+ for(QStringList::ConstIterator iter = argList.constBegin(); iter != argList.constEnd(); iter++)
131131 {
132- const QString &argStr = argList[i];
133- if(argStr.startsWith(argPrefix))
132+ if(firstToken)
133+ {
134+ firstToken = false;
135+ continue; /*skip executable file name*/
136+ }
137+ if(iter->startsWith(argPrefix))
134138 {
135- const QString argData = argStr.mid(2).trimmed();
139+ const QString argData = iter->mid(2).trimmed();
136140 if(argData.length() > 0)
137141 {
138142 const int separatorIndex = argData.indexOf(separator);
Show on old repository browser