mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 10:19:04 +00:00
sh: reset sh bindings on bind -e, bind -v
Until this change, any bindings set in histedit() were lost on calls to bindcmd(). Only bind -e and bind -v call libedit's keymacro_reset(). Currently you cannot fool libedit/map.c:map_bind() by trying something like bind -le as when p[0] == '-', it does a switch statement on p[1].
This commit is contained in:
parent
908b8e32f9
commit
9413dfd331
|
@ -559,6 +559,13 @@ bindcmd(int argc, char **argv)
|
|||
|
||||
fclose(out);
|
||||
|
||||
if (argc > 1 && argv[1][0] == '-' &&
|
||||
memchr("ve", argv[1][1], 2) != NULL) {
|
||||
Vflag = argv[1][1] == 'v';
|
||||
Eflag = !Vflag;
|
||||
histedit();
|
||||
}
|
||||
|
||||
INTON;
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue