summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing/toxic/prompt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c
index e194a90e..6c762c86 100644
--- a/testing/toxic/prompt.c
+++ b/testing/toxic/prompt.c
@@ -358,8 +358,16 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
358 int numargs = 0; 358 int numargs = 0;
359 359
360 for (i = 0; i < MAX_STR_SIZE; i++) { 360 for (i = 0; i < MAX_STR_SIZE; i++) {
361 if (cmd[i] == '\"') 361 char quote_chr;
362 while (cmd[++i] != '\"'); /* skip over strings */ 362 if (cmd[i] == '\"' || cmd[i] == '\'') {
363 quote_chr = cmd[i];
364 while (cmd[++i] != quote_chr && i < MAX_STR_SIZE); /* skip over strings */
365 /* Check if got qoute character */
366 if (cmd[i] != quote_chr) {
367 wprintw(self->window, "Missing terminating %c character\n", quote_chr);
368 return;
369 }
370 }
363 371
364 if (cmd[i] == ' ') { 372 if (cmd[i] == ' ') {
365 cmd[i] = '\0'; 373 cmd[i] = '\0';