aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-12-09 11:52:55 +0000
committerLibravatar Ian Fan <ianfan0@gmail.com>2019-01-01 09:01:24 +0000
commit967566e37f93890bd5255725129c929aeeac709e (patch)
tree7d6bc1470609b2c0da92889db36833cc2e5e8431 /sway/commands.c
parentbash: add completion for swaybar (diff)
downloadsway-967566e37f93890bd5255725129c929aeeac709e.tar.gz
sway-967566e37f93890bd5255725129c929aeeac709e.tar.zst
sway-967566e37f93890bd5255725129c929aeeac709e.zip
stringop.c: rewrite strip_whitespace
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 927434bc..cd595b03 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -236,15 +236,15 @@ list_t *execute_command(char *_exec, struct sway_seat *seat,
236 criteria_destroy(criteria); 236 criteria_destroy(criteria);
237 config->handler_context.using_criteria = true; 237 config->handler_context.using_criteria = true;
238 // Skip leading whitespace 238 // Skip leading whitespace
239 head += strspn(head, whitespace); 239 for (; isspace(*head); ++head) {}
240 } 240 }
241 // Split command list 241 // Split command list
242 cmdlist = argsep(&head, ";"); 242 cmdlist = argsep(&head, ";");
243 cmdlist += strspn(cmdlist, whitespace); 243 for (; isspace(*cmdlist); ++cmdlist) {}
244 do { 244 do {
245 // Split commands 245 // Split commands
246 cmd = argsep(&cmdlist, ","); 246 cmd = argsep(&cmdlist, ",");
247 cmd += strspn(cmd, whitespace); 247 for (; isspace(*cmd); ++cmd) {}
248 if (strcmp(cmd, "") == 0) { 248 if (strcmp(cmd, "") == 0) {
249 wlr_log(WLR_INFO, "Ignoring empty command."); 249 wlr_log(WLR_INFO, "Ignoring empty command.");
250 continue; 250 continue;