]> git.mdlowis.com Git - projs/tide.git/commitdiff
tweaked argument handling for tags
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 12 Sep 2018 14:17:57 +0000 (10:17 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 12 Sep 2018 14:17:57 +0000 (10:17 -0400)
tide.c

diff --git a/tide.c b/tide.c
index bd699e22eaf4f5a4e133f52953875926d67e1e29..9061df1f93bfca13a99da51dbe16c0ba7ff5958a 100644 (file)
--- a/tide.c
+++ b/tide.c
@@ -91,7 +91,8 @@ void exec(char* cmd) {
     /* see if it matches a builtin tag */
     Tag* tag = tag_lookup(cmd);
     if (tag) {
-        while (*cmd && !isspace(*cmd++));
+        for (; *cmd && !isspace(*cmd); cmd++); /* strip off tag name */
+        for (; *cmd && isspace(*cmd); cmd++);  /* strip off leading space */
         tag_exec(tag, (*cmd ? strdup(cmd) : NULL));
     } else {
         cmd_exec(cmd);