diff options
author | Theo Deraadt <deraadt@openbsd.org> | 2009-10-26 21:42:04 +0000 |
---|---|---|
committer | Theo Deraadt <deraadt@openbsd.org> | 2009-10-26 21:42:04 +0000 |
commit | ed62d1263ca180e8b088111bf77b8c7b4b2073de (patch) | |
tree | 5fd748fd66f696e05a275d5a4d58486c9d160cfe /cmd-string.c | |
parent | a8b1379ccbfbe7f1d7732147c4969bb92499555d (diff) | |
download | rtmux-ed62d1263ca180e8b088111bf77b8c7b4b2073de.tar.gz rtmux-ed62d1263ca180e8b088111bf77b8c7b4b2073de.tar.bz2 rtmux-ed62d1263ca180e8b088111bf77b8c7b4b2073de.zip |
tabs are better; ok nicm
Diffstat (limited to 'cmd-string.c')
-rw-r--r-- | cmd-string.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/cmd-string.c b/cmd-string.c index 41b20948..06f01a54 100644 --- a/cmd-string.c +++ b/cmd-string.c @@ -204,33 +204,33 @@ cmd_string_string(const char *s, size_t *p, char endch, int esc) char *buf, *t; size_t len; - buf = NULL; + buf = NULL; len = 0; - while ((ch = cmd_string_getc(s, p)) != endch) { - switch (ch) { + while ((ch = cmd_string_getc(s, p)) != endch) { + switch (ch) { case EOF: goto error; - case '\\': + case '\\': if (!esc) break; - switch (ch = cmd_string_getc(s, p)) { + switch (ch = cmd_string_getc(s, p)) { case EOF: goto error; case 'e': ch = '\033'; break; - case 'r': - ch = '\r'; - break; - case 'n': - ch = '\n'; - break; - case 't': - ch = '\t'; - break; - } - break; + case 'r': + ch = '\r'; + break; + case 'n': + ch = '\n'; + break; + case 't': + ch = '\t'; + break; + } + break; case '$': if (!esc) break; @@ -241,13 +241,13 @@ cmd_string_string(const char *s, size_t *p, char endch, int esc) len += strlen(t); xfree(t); continue; - } + } if (len >= SIZE_MAX - 2) goto error; buf = xrealloc(buf, 1, len + 1); - buf[len++] = ch; - } + buf[len++] = ch; + } buf = xrealloc(buf, 1, len + 1); buf[len] = '\0'; @@ -272,7 +272,7 @@ cmd_string_variable(const char *s, size_t *p) ((ch) >= 'a' && (ch) <= 'z') || ((ch) >= 'A' && (ch) <= 'Z') || \ ((ch) >= '0' && (ch) <= '9')) - buf = NULL; + buf = NULL; len = 0; fch = EOF; |