summaryrefslogtreecommitdiffstats
path: root/bin/ksh/emacs.c
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2003-08-02 19:26:15 +0000
committerfgsch <fgsch@openbsd.org>2003-08-02 19:26:15 +0000
commitab8d2853072473831372b99ea7e43303a26ad683 (patch)
tree2713bc732e8e10d19757dd5bf982a0123b4dabbe /bin/ksh/emacs.c
parentmissing include (diff)
downloadwireguard-openbsd-ab8d2853072473831372b99ea7e43303a26ad683.tar.xz
wireguard-openbsd-ab8d2853072473831372b99ea7e43303a26ad683.zip
On ESC-y ESC-y (yank-pop), also check that there is something to
insert (some text has been killed before). from otto@, fix PR/3384. On yank-pop error (no yank before), reset the index to killstack so another yank-pop does not mangle the prompt if nothing was yanked, and to avoid replacing a text when it shouldn't (yank <something> yank-pop yank-pop). otto@ ok.
Diffstat (limited to 'bin/ksh/emacs.c')
-rw-r--r--bin/ksh/emacs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ksh/emacs.c b/bin/ksh/emacs.c
index 3ec71f04bf5..06834c1b033 100644
--- a/bin/ksh/emacs.c
+++ b/bin/ksh/emacs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: emacs.c,v 1.20 2003/06/26 00:09:45 deraadt Exp $ */
+/* $OpenBSD: emacs.c,v 1.21 2003/08/02 19:26:15 fgsch Exp $ */
/*
* Emacs-like command line editing and history
@@ -1264,7 +1264,9 @@ x_meta_yank(c)
int c;
{
int len;
- if (x_last_command != XFUNC_yank && x_last_command != XFUNC_meta_yank) {
+ if ((x_last_command != XFUNC_yank && x_last_command != XFUNC_meta_yank)
+ || killstack[killtp] == 0) {
+ killtp = killsp;
x_e_puts("\nyank something first");
x_redraw(-1);
return KSTD;