mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-13 02:03:03 +01:00
fixed space handling in commands (issue #495)
This commit is contained in:
parent
f017a76c4a
commit
512abe64f4
8
prompt.c
8
prompt.c
@ -363,6 +363,11 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
|
||||
|
||||
if (cmd[i] == ' ') {
|
||||
cmd[i] = '\0';
|
||||
|
||||
int j = i;
|
||||
while (++j < MAX_STR_SIZE && isspace(cmd[j]));
|
||||
i = j - 1;
|
||||
|
||||
numargs++;
|
||||
}
|
||||
}
|
||||
@ -380,6 +385,9 @@ static void execute(ToxWindow *self, Messenger *m, char *u_cmd)
|
||||
for (i = 0; i < 5; i++) {
|
||||
cmdargs[i] = cmd + pos;
|
||||
pos += strlen(cmdargs[i]) + 1;
|
||||
|
||||
while (isspace(cmd[pos]) && pos < MAX_STR_SIZE)
|
||||
++pos;
|
||||
}
|
||||
|
||||
/* no input */
|
||||
|
Loading…
Reference in New Issue
Block a user