about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-07-20 21:02:07 +0100
committerJames Booth <boothj5@gmail.com>2013-07-20 21:02:07 +0100
commit7af6bad5e69742386747e05e749589d937bb1377 (patch)
treed9170b2270f832fd95bee8d8a1f3932001824807
parent8137efbfa3a99b3e1b2f8aeeab90fe44220abc33 (diff)
downloadprofani-tty-7af6bad5e69742386747e05e749589d937bb1377.tar.gz
Fix freetext arguments with quotes
fixes #203
-rw-r--r--src/tools/parser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/parser.c b/src/tools/parser.c
index f4cfc3d2..dabf7128 100644
--- a/src/tools/parser.c
+++ b/src/tools/parser.c
@@ -242,15 +242,15 @@ parse_args_with_freetext(const char * const inp, int min, int max)
                     }
                 }
             } else {
-                if (!in_freetext && curr_uni == ' ') {
+                if (in_freetext) {
+                    token_size += g_unichar_to_utf8(curr_uni, NULL);
+                } else if (curr_uni == ' ') {
                     tokens = g_slist_append(tokens, g_strndup(token_start,
                         token_size));
                     token_size = 0;
                     in_token = FALSE;
-                } else {
-                    if (curr_uni != '"') {
-                        token_size += g_unichar_to_utf8(curr_uni, NULL);
-                    }
+                } else if (curr_uni != '"') {
+                    token_size += g_unichar_to_utf8(curr_uni, NULL);
                 }
             }
         }