dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 052a044e36b2ccdd49b2cd1dac111bf7eccd5641
parent f2053c9bad2e1f80d0dc10c348a690ce9dbe6b86
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Mon,  7 Jan 2013 22:28:02 +0100

Fix quote handling in cmd-fifo parsing code

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
dvtm.c | 17++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -1106,17 +1106,14 @@ handle_cmdfifo() { /* remove the escape character '\\' move every * following character to the left by one position */ - switch (*(++p)) { + switch (p[1]) { case '\\': case '\'': case '\"': { - char *t = p; - for (;;) { - *(t - 1) = *t; - if (*t++ == '\0') - break; - } - p -= 2; + char *t = p+1; + do { + t[-1] = *t; + } while (*t++); } } break; @@ -1139,12 +1136,14 @@ handle_cmdfifo() { while (*p == ' ') ++p; - arg = p; + arg = p--; } break; } if (c == '\n' || *p == '\n') { + if (!*p) + p++; debug("execute %s", s); for(int i = 0; i < argc; i++) debug(" %s", args[i]);