diff options
-rw-r--r-- | tterm.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -131,8 +131,10 @@ loop: if (strncmp(line, "cwd", 3) == 0) { XStoreName(display, w, cwd); XFlush(display); } else if (strncmp(line, "cmd", 3) == 0) { - line[len-1] = 0; - line += 3; + line[len-1] = 0; len -= 1; + line += 3; len -= 3; + for (i = len-1; i > 0 && line[i] == ' '; i--) + line[i] = 0; /* strip space */ snprintf(cmd, MAX_CMD, "%s (%s)", line, cwd); XStoreName(display, w, cmd); XFlush(display); |