make split_value_list() even less sane again
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>
Wed, 3 Jul 2013 11:54:17 +0000 (13:54 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 26 Aug 2013 21:57:08 +0000 (23:57 +0200)
contrary to what one may expect, it's actually *not* supposed to remove
the meta-characters it interprets.

luckily, this function is not used much any more ...

Change-Id: I2b60f9b173140da78db2b07b596cc2e5f6e6d555
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qtbase/783181cfc11e995ad678237ebc0025a2a023c88c)

src/linguist/shared/qmakeevaluator.cpp

index 18cb6e9..6bd1c58 100644 (file)
@@ -277,6 +277,8 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
         ushort unicode = vals_data[x].unicode();
         if (unicode == quote) {
             quote = 0;
+            hadWord = true;
+            build += QChar(unicode);
             continue;
         }
         switch (unicode) {
@@ -284,7 +286,7 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
         case '\'':
             quote = unicode;
             hadWord = true;
-            continue;
+            break;
         case ' ':
         case '\t':
             if (!quote) {
@@ -295,22 +297,23 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
                 }
                 continue;
             }
-            build += QChar(unicode);
             break;
         case '\\':
             if (x + 1 != vals_len) {
                 ushort next = vals_data[++x].unicode();
-                if (next == '\'' || next == '"' || next == '\\')
+                if (next == '\'' || next == '"' || next == '\\') {
+                    build += QChar(unicode);
                     unicode = next;
-                else
+                } else {
                     --x;
+                }
             }
             // fallthrough
         default:
             hadWord = true;
-            build += QChar(unicode);
             break;
         }
+        build += QChar(unicode);
     }
     if (hadWord)
         ret << ProString(build).setSource(source);