=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-string.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- src/usr.bin/tmux/Attic/cmd-string.c 2010/01/31 18:47:03 1.13 +++ src/usr.bin/tmux/Attic/cmd-string.c 2010/02/19 17:14:23 1.14 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-string.c,v 1.13 2010/01/31 18:47:03 nicm Exp $ */ +/* $OpenBSD: cmd-string.c,v 1.14 2010/02/19 17:14:23 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -61,7 +61,7 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, char **cause) { size_t p; - int ch, i, argc, rval, have_arg; + int ch, i, argc, rval; char **argv, *buf, *t; const char *whitespace, *equals; size_t len; @@ -72,8 +72,6 @@ buf = NULL; len = 0; - have_arg = 0; - *cause = NULL; *cmdlist = NULL; @@ -90,8 +88,6 @@ strlcpy(buf + len, t, strlen(t) + 1); len += strlen(t); xfree(t); - - have_arg = 1; break; case '"': if ((t = cmd_string_string(s, &p, '"', 1)) == NULL) @@ -100,8 +96,6 @@ strlcpy(buf + len, t, strlen(t) + 1); len += strlen(t); xfree(t); - - have_arg = 1; break; case '$': if ((t = cmd_string_variable(s, &p)) == NULL) @@ -110,8 +104,6 @@ strlcpy(buf + len, t, strlen(t) + 1); len += strlen(t); xfree(t); - - have_arg = 1; break; case '#': /* Comment: discard rest of line. */ @@ -121,7 +113,7 @@ case EOF: case ' ': case '\t': - if (have_arg) { + if (buf != NULL) { buf = xrealloc(buf, 1, len + 1); buf[len] = '\0'; @@ -130,8 +122,6 @@ buf = NULL; len = 0; - - have_arg = 0; } if (ch != EOF) @@ -156,7 +146,7 @@ rval = 0; goto out; case '~': - if (have_arg == 0) { + if (buf == NULL) { if ((t = cmd_string_expand_tilde(s, &p)) == NULL) goto error; buf = xrealloc(buf, 1, len + strlen(t) + 1); @@ -172,8 +162,6 @@ buf = xrealloc(buf, 1, len + 1); buf[len++] = ch; - - have_arg = 1; break; } }