diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-08-14 18:16:53 +0200 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2023-08-14 18:16:53 +0200 |
commit | 91ba4cf75ee30c64779edb5b7644e5a830de5026 (patch) | |
tree | aa8c2433bfc3a54577aceeb706c4c2cd0986c95d /launcher/Commandline.cpp | |
parent | 779f70057b021e285afd60cc650a14cd5feacffd (diff) | |
download | PrismLauncher-91ba4cf75ee30c64779edb5b7644e5a830de5026.tar.gz PrismLauncher-91ba4cf75ee30c64779edb5b7644e5a830de5026.tar.bz2 PrismLauncher-91ba4cf75ee30c64779edb5b7644e5a830de5026.zip |
chore: reformat
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/Commandline.cpp')
-rw-r--r-- | launcher/Commandline.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/launcher/Commandline.cpp b/launcher/Commandline.cpp index 6d97918d..4fac024a 100644 --- a/launcher/Commandline.cpp +++ b/launcher/Commandline.cpp @@ -41,8 +41,7 @@ * @file libutil/src/cmdutils.cpp */ -namespace Commandline -{ +namespace Commandline { // commandline splitter QStringList splitArgs(QString args) @@ -51,19 +50,15 @@ QStringList splitArgs(QString args) QString current; bool escape = false; QChar inquotes; - for (int i = 0; i < args.length(); i++) - { + for (int i = 0; i < args.length(); i++) { QChar cchar = args.at(i); // \ escaped - if (escape) - { + if (escape) { current += cchar; escape = false; // in "quotes" - } - else if (!inquotes.isNull()) - { + } else if (!inquotes.isNull()) { if (cchar == '\\') escape = true; else if (cchar == inquotes) @@ -71,18 +66,13 @@ QStringList splitArgs(QString args) else current += cchar; // otherwise - } - else - { - if (cchar == ' ') - { - if (!current.isEmpty()) - { + } else { + if (cchar == ' ') { + if (!current.isEmpty()) { argv << current; current.clear(); } - } - else if (cchar == '"' || cchar == '\'') + } else if (cchar == '"' || cchar == '\'') inquotes = cchar; else current += cchar; @@ -92,4 +82,4 @@ QStringList splitArgs(QString args) argv << current; return argv; } -} +} // namespace Commandline |