summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-01-26 18:33:02 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-01-26 19:40:45 +0000
commitf3060312c89344744832e3352fe4f53efcb94c9b (patch)
treede69be5e25a1acd3207a8952376f634fe94fefcc /src/corelib/kernel
parentc29d3692d700f7ef6d5833242878b4ec6f81c928 (diff)
parenta15c3d086dafea83e4760f0b447be43d26b80697 (diff)
Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index c49994a98d..60f3dc0db0 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -183,16 +183,18 @@ void QCoreApplicationPrivate::processCommandLineArguments()
{
int j = argc ? 1 : 0;
for (int i = 1; i < argc; ++i) {
- if (argv[i] && *argv[i] != '-') {
+ if (!argv[i])
+ continue;
+ if (*argv[i] != '-') {
argv[j++] = argv[i];
continue;
}
- QByteArray arg = argv[i];
- if (arg.startsWith("--"))
- arg.remove(0, 1);
- if (arg.startsWith("-qmljsdebugger=")) {
- qmljs_debug_arguments = QString::fromLocal8Bit(arg.right(arg.length() - 15));
- } else if (arg == "-qmljsdebugger" && i < argc - 1) {
+ const char *arg = argv[i];
+ if (arg[1] == '-') // startsWith("--")
+ ++arg;
+ if (strncmp(arg, "-qmljsdebugger=", 15) == 0) {
+ qmljs_debug_arguments = QString::fromLocal8Bit(arg + 15);
+ } else if (strcmp(arg, "-qmljsdebugger") == 0 && i < argc - 1) {
++i;
qmljs_debug_arguments = QString::fromLocal8Bit(argv[i]);
} else {