Fix autocompletion of quoted strings - WIP

Needs some refactoring
Need to use unicode functions in:
    parser.c
    autocomplete.c
This commit is contained in:
James Booth
2013-07-09 22:34:55 +01:00
parent 581c1e8b95
commit e99a0e117a
2 changed files with 104 additions and 23 deletions

View File

@@ -201,8 +201,14 @@ parse_args_with_freetext(const char * const inp, int min, int max)
in_quotes = TRUE;
i++;
}
token_start = &copy[i];
token_size++;
if (copy[i] == '"') {
token_start = &copy[i+1];
} else {
token_start = &copy[i];
}
if (copy[i] != '"') {
token_size++;
}
}
} else {
if (in_quotes) {
@@ -213,7 +219,9 @@ parse_args_with_freetext(const char * const inp, int min, int max)
in_token = FALSE;
in_quotes = FALSE;
} else {
token_size++;
if (copy[i] != '"') {
token_size++;
}
}
} else {
if ((!in_freetext && copy[i] == ' ') || copy[i] == '\0') {
@@ -222,7 +230,9 @@ parse_args_with_freetext(const char * const inp, int min, int max)
token_size = 0;
in_token = FALSE;
} else {
token_size++;
if (copy[i] != '"') {
token_size++;
}
}
}
}