aboutsummaryrefslogtreecommitdiffstats
path: root/pw.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-06-15 18:14:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-06-15 18:14:06 -0700
commit6c8630a7ff8af9f01fdeb79c99fa360d29b0c293 (patch)
tree42bd3e9d6861dfd902165dcbed8f9f07ab10f429 /pw.c
parent71bbfa562d0299f443381dce206dd5662ffea744 (diff)
downloadpw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.tar.gz
pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.tar.bz2
pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.zip
Regression: command histories conflated.
Diffstat (limited to 'pw.c')
-rw-r--r--pw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/pw.c b/pw.c
index b675a4d..ff4b352 100644
--- a/pw.c
+++ b/pw.c
@@ -1887,10 +1887,10 @@ int main(int argc, char **argv)
if (ch == CR) {
int count = (cmdcount == INT_MAX) ? 0 : cmdcount;
if (pw.cmdbuf[1]) {
- int *pnhist = (kbd_state == kbd_lcmd ? &ncmdhist : &npathist);
+ int iscolon = pw.cmdbuf[0] == ':';
+ int *pnhist = (iscolon ? &ncmdhist : &npathist);
int nhist = *pnhist;
- char ***hist = (kbd_state == kbd_lcmd ?
- &cmdhist : &pathist);
+ char ***hist = (iscolon ? &cmdhist : &pathist);
if (nhist == 0 || strcmp(pw.cmdbuf, (*hist)[0]) != 0) {
if ((*hist = resizebuf(*hist, nhist, nhist + 1)) == 0)
@@ -1977,8 +1977,9 @@ int main(int argc, char **argv)
case ctrl('p'):
case ctrl('n'):
{
- int nhist = (kbd_state == kbd_lcmd ? ncmdhist : npathist);
- char ***hist = (kbd_state == kbd_lcmd ? &cmdhist : &pathist);
+ int iscolon = pw.cmdbuf[0] == ':';
+ int nhist = (iscolon ? ncmdhist : npathist);
+ char ***hist = (iscolon ? &cmdhist : &pathist);
if (ch == ctrl('p')) {
if (histpos == 0) {