mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-16 08:48:06 +02:00
zsh-workers:6205
This commit is contained in:
parent
e6f546e901
commit
f52a9fb11e
3 changed files with 17 additions and 27 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -189,9 +189,6 @@
|
|||
/* Define to 1 if struct timezone is defined by a system header */
|
||||
#undef HAVE_STRUCT_TIMEZONE
|
||||
|
||||
/* Define if your system's typeahead disappears from the shell editor. */
|
||||
#undef CLOBBERS_TYPEAHEAD
|
||||
|
||||
/* Define to 1 if there is a prototype defined for brk() on your system */
|
||||
#undef HAVE_BRK_PROTO
|
||||
|
||||
|
|
19
configure.in
19
configure.in
|
@ -883,25 +883,6 @@ zsh_PATH_UTMP(wtmp)
|
|||
zsh_PATH_UTMP(utmpx)
|
||||
zsh_PATH_UTMP(wtmpx)
|
||||
|
||||
dnl ----------------
|
||||
dnl TYPEAHEAD KLUDGE
|
||||
dnl ----------------
|
||||
dnl Some systems clobber typeahead when you go from canonical input
|
||||
dnl processing to non-canonical, so we need a FIONREAD ioctl.
|
||||
dnl I don't know how to check this with configure, so I am using the
|
||||
dnl system names directly.
|
||||
dnl The doubled square brackets are necessary because autoconf uses m4.
|
||||
AC_CACHE_CHECK(if typeahead needs FIONREAD, zsh_cv_sys_clobbers_typeahead,
|
||||
[case x-$host_vendor-$host_os in
|
||||
x-*-ultrix* | x-*-dgux* | x-sni-sysv4* | x-*-irix*)
|
||||
zsh_cv_sys_clobbers_typeahead=yes;;
|
||||
*)
|
||||
zsh_cv_sys_clobbers_typeahead=no;;
|
||||
esac])
|
||||
if test $zsh_cv_sys_clobbers_typeahead = yes; then
|
||||
AC_DEFINE(CLOBBERS_TYPEAHEAD)
|
||||
fi
|
||||
|
||||
dnl -------------------
|
||||
dnl brk/sbrk PROTOTYPES
|
||||
dnl -------------------
|
||||
|
|
Loading…
Reference in a new issue