about summary refs log tree commit diff
path: root/Src/Zle/zle_hist.c
diff options
context:
space:
mode:
authorAndrew Main <zefram@users.sourceforge.net>2001-09-03 01:39:19 +0000
committerAndrew Main <zefram@users.sourceforge.net>2001-09-03 01:39:19 +0000
commitb73d71105eaca6ae001a3e836ab08406ef188789 (patch)
tree691753f67199df3b7c9cfdaec6b5dd88cb14bf18 /Src/Zle/zle_hist.c
parente8f8c3abee5763d58cfcb8eb89e50ec40dbcfde2 (diff)
downloadzsh-b73d71105eaca6ae001a3e836ab08406ef188789.tar.gz
zsh-b73d71105eaca6ae001a3e836ab08406ef188789.tar.xz
zsh-b73d71105eaca6ae001a3e836ab08406ef188789.zip
15734: zle -K option to select a keymap, and zle KEYMAP parameter to
examine the current selection.
Diffstat (limited to 'Src/Zle/zle_hist.c')
-rw-r--r--Src/Zle/zle_hist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 9719e5418..d7223316c 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -660,7 +660,7 @@ doisearch(char **args, int dir)
     int odir = dir, sens = zmult == 1 ? 3 : 1;
     int hl = histline, savekeys = -1, feep = 0;
     Thingy cmd;
-    char *okeymap = curkeymapname;
+    char *okeymap = ztrdup(curkeymapname);
     static char *previous_search = NULL;
     static int previous_search_len = 0;
     Histent he;
@@ -883,6 +883,7 @@ doisearch(char **args, int dir)
     }
     statusline = NULL;
     selectkeymap(okeymap, 1);
+    zsfree(okeymap);
     /*
      * Don't allow unused characters provided as a string to the
      * widget to overflow and be used as separated commands.
@@ -960,7 +961,7 @@ getvisrchstr(void)
     char *sbuf = zhalloc(80);
     int sptr = 1, ret = 0, ssbuf = 80, feep = 0;
     Thingy cmd;
-    char *okeymap = curkeymapname;
+    char *okeymap = ztrdup(curkeymapname);
 
     if (vipenultsrchstr) {
 	zsfree(vipenultsrchstr);
@@ -1044,6 +1045,7 @@ getvisrchstr(void)
     }
     statusline = NULL;
     selectkeymap(okeymap, 1);
+    zsfree(okeymap);
     return ret;
 }