mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
stringop.c: rewrite strip_whitespace
This commit is contained in:
parent
3b4cf3718b
commit
967566e37f
5 changed files with 17 additions and 27 deletions
|
|
@ -236,15 +236,15 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
|
|||
criteria_destroy(criteria);
|
||||
config->handler_context.using_criteria = true;
|
||||
// Skip leading whitespace
|
||||
head += strspn(head, whitespace);
|
||||
for (; isspace(*head); ++head) {}
|
||||
}
|
||||
// Split command list
|
||||
cmdlist = argsep(&head, ";");
|
||||
cmdlist += strspn(cmdlist, whitespace);
|
||||
for (; isspace(*cmdlist); ++cmdlist) {}
|
||||
do {
|
||||
// Split commands
|
||||
cmd = argsep(&cmdlist, ",");
|
||||
cmd += strspn(cmd, whitespace);
|
||||
for (; isspace(*cmd); ++cmd) {}
|
||||
if (strcmp(cmd, "") == 0) {
|
||||
wlr_log(WLR_INFO, "Ignoring empty command.");
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue