diff --git a/configure.in b/configure.in index f717cbe2..30aa6f8a 100644 --- a/configure.in +++ b/configure.in @@ -302,6 +302,8 @@ AC_CHECK_FUNCS(setpgid getpgid setpgrp getpgrp) AC_CHECK_FUNCS(raise, HAVE_RAISE=yes) AC_CHECK_FUNCS(kill, HAVE_KILL=yes) +AC_CHECK_FUNCS(fpathconf, HAVE_FPATHCONF=yes) + if test x"$HAVE_RAISE" = x; then if test x"$HAVE_KILL" = x || test x"$HAVE_GETPID" = x; then AC_MSG_ERROR([Unable to emulate raise()]) diff --git a/src/terminal/kbd.c b/src/terminal/kbd.c index cd50a078..9eb7021a 100644 --- a/src/terminal/kbd.c +++ b/src/terminal/kbd.c @@ -234,7 +234,7 @@ static int setraw(struct itrm *itrm, int save_orig) { struct termios t; - long vdisable; + long vdisable = -1; memset(&t, 0, sizeof(t)); if (tcgetattr(itrm->in.ctl, &t)) return -1; @@ -243,13 +243,19 @@ setraw(struct itrm *itrm, int save_orig) #ifdef _POSIX_VDISABLE vdisable = _POSIX_VDISABLE; -#else +#elif defined(HAVE_FPATHCONF) vdisable = fpathconf(itrm->in.ctl, _PC_VDISABLE); #endif + +#ifdef VERASE +/* Is VERASE defined on Windows? */ if (vdisable != -1 && t.c_cc[VERASE] == vdisable) itrm->verase = -1; else itrm->verase = (unsigned char) t.c_cc[VERASE]; +#else + itrm->verase = -1; +#endif elinks_cfmakeraw(&t); t.c_lflag |= ISIG;