aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-27 23:46:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-27 23:46:49 -0700
commit7a46e6df55c9148c5a361ce94b09a5c0c0e22b4c (patch)
tree03c67b3f5b6722c636549fc14089ee3ea9a6c0ac
parentb6508e385389a72d0f2fc9329b6c8ed2087ea813 (diff)
downloadpw-7a46e6df55c9148c5a361ce94b09a5c0c0e22b4c.tar.gz
pw-7a46e6df55c9148c5a361ce94b09a5c0c0e22b4c.tar.bz2
pw-7a46e6df55c9148c5a361ce94b09a5c0c0e22b4c.zip
No kbd_result state for commands with no result string.
-rw-r--r--pw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pw.c b/pw.c
index 1a10c24..cb1c4cd 100644
--- a/pw.c
+++ b/pw.c
@@ -246,6 +246,7 @@ static void execute(char *cmd)
char *arg = cmd + 2 + strspn(cmd + 2, " \t");
clrline();
+ cmd[0] = 0;
switch (cmd[1]) {
case 'w': case 'a':
@@ -600,9 +601,10 @@ int main(int argc, char **argv)
if (ch == 13) {
if (kbd_state == kbd_colon && cmdbuf[1]) {
execute(cmdbuf);
- stat &= ~stat_dirty;
- kbd_state = kbd_result;
- break;
+ if (cmdbuf[0] != 0) {
+ kbd_state = kbd_result;
+ break;
+ }
} else if (cmdbuf[1]) {
int err;
trigpat = dsdup(cmdbuf + 1);