diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-05-04 21:27:55 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-05-04 21:27:55 +0000 |
commit | f52a9fb11e61a5b62fa77d43fb635556de3fb648 (patch) | |
tree | 2025168626b17637565f071b8bfcd7c364f83ed7 /Src/Zle/zle_main.c | |
parent | e6f546e9010a76d89159a1b5587ce23ef6b8f5cf (diff) | |
download | zsh-f52a9fb11e61a5b62fa77d43fb635556de3fb648.tar.gz zsh-f52a9fb11e61a5b62fa77d43fb635556de3fb648.tar.xz zsh-f52a9fb11e61a5b62fa77d43fb635556de3fb648.zip |
zsh-workers:6205
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r-- | Src/Zle/zle_main.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 46721b641..be82672f8 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -119,12 +119,16 @@ zsetterm(void) { struct ttyinfo ti; -#if defined(CLOBBERS_TYPEAHEAD) && defined(FIONREAD) +#if defined(FIONREAD) int val; ioctl(SHTTY, FIONREAD, (char *)&val); - if (val) - return; + if (val) { + char *tmpline = (char *)zalloc(val); + read(SHTTY, tmpline, val); + ungetkeys(tmpline, val); + zfree(tmpline, val); + } #endif /* sanitize the tty */ @@ -656,14 +660,18 @@ handleprefixes(void) initmodifier(&zmod); } +/* this exports the argument we are currently vared'iting if != NULL */ + +/**/ +char *varedarg; + /* vared: edit (literally) a parameter value */ /**/ static int bin_vared(char *name, char **args, char *ops, int func) { - char *s; - char *t; + char *s, *t, *ova = varedarg; Value v; Param pm = 0; int create = 0; @@ -753,7 +761,9 @@ bin_vared(char *name, char **args, char *ops, int func) PERMALLOC { pushnode(bufstack, ztrdup(s)); } LASTALLOC; + varedarg = *args; t = (char *) zleread(p1, p2, ops['h'] ? ZLRF_HISTORY : 0); + varedarg = ova; if (!t || errflag) { /* error in editing */ errflag = 0; @@ -927,6 +937,8 @@ setup_zle(Module m) /* initialise the keymap system */ init_keymaps(); + varedarg = NULL; + return 0; } |