summaryrefslogtreecommitdiffstats
path: root/cmd-string.c
authornicm <nicm>2008-09-26 06:45:25 (GMT)
committer nicm <nicm>2008-09-26 06:45:25 (GMT)
commit19ec0854301171093b1ff57e957e3c991f01540c (patch) (side-by-side diff)
treec605019bd59c9addd83836bea8ac7d966b9fc399 /cmd-string.c
parent275a8b72feea7889a6cd36ee5ffe3020836da5a1 (diff)
downloadtmux-old-19ec0854301171093b1ff57e957e3c991f01540c.zip
tmux-old-19ec0854301171093b1ff57e957e3c991f01540c.tar.gz
tmux-old-19ec0854301171093b1ff57e957e3c991f01540c.tar.bz2
Trim.
Diffstat (limited to 'cmd-string.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-string.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd-string.c b/cmd-string.c
index ad1881b..e1e7e81 100644
--- a/cmd-string.c
+++ b/cmd-string.c
@@ -48,10 +48,10 @@ cmd_string_ungetc(unused const char *s, size_t *p)
(*p)--;
}
-/*
+/*
* Parse command string. Returns -1 on error. If returning -1, cause is error
* string, or NULL for empty command.
- */
+ */
int
cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
{
@@ -81,7 +81,7 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
*cmd = NULL;
rval = -1;
-
+
p = 0;
for (;;) {
ch = cmd_string_getc(s, &p);
@@ -130,7 +130,7 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
break;
if (argc == 0)
goto out;
-
+
*cmd = cmd_parse(argc, argv, cause);
rval = 0;
goto out;
@@ -143,10 +143,10 @@ cmd_string_parse(const char *s, struct cmd **cmd, char **cause)
break;
}
}
-
+
error:
xasprintf(cause, "bad command: %s", s);
-
+
out:
if (buf != NULL)
xfree(buf);
@@ -252,7 +252,7 @@ cmd_string_variable(const char *s, size_t *p)
buf = xrealloc(buf, 1, len + 1);
buf[len++] = ch;
-
+
for(;;) {
ch = cmd_string_getc(s, p);
if (ch == EOF || !cmd_string_other(ch))
@@ -284,5 +284,5 @@ cmd_string_variable(const char *s, size_t *p)
error:
if (buf != NULL)
xfree(buf);
- return (NULL);
+ return (NULL);
}