summaryrefslogtreecommitdiff
path: root/testing/toxic/prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'testing/toxic/prompt.c')
-rw-r--r--testing/toxic/prompt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c
index 89c87d8f..a96c07bb 100644
--- a/testing/toxic/prompt.c
+++ b/testing/toxic/prompt.c
@@ -52,6 +52,11 @@ static void execute(ToxWindow *self, char *u_cmd)
52 cmd[i - newlines] = u_cmd[i]; 52 cmd[i - newlines] = u_cmd[i];
53 } 53 }
54 54
55 int leading_spc = 0;
56 for (i = 0; i < 256 && isspace(cmd[i]); ++i)
57 leading_spc++;
58 memmove(cmd, cmd + leading_spc, 256 - leading_spc);
59
55 if (!strcmp(cmd, "quit") || !strcmp(cmd, "exit") || !strcmp(cmd, "q")) { 60 if (!strcmp(cmd, "quit") || !strcmp(cmd, "exit") || !strcmp(cmd, "q")) {
56 endwin(); 61 endwin();
57 exit(0); 62 exit(0);