From 59c1302eadd5bb4f1ca88279d1bfd21617074ab0 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 17 Aug 1997 08:50:46 +0000 Subject: [PATCH] sgtty-support from Luke Howard git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3042 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/editline/sysunix.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/editline/sysunix.c b/lib/editline/sysunix.c index 2532f4d6d..cd178d728 100644 --- a/lib/editline/sysunix.c +++ b/lib/editline/sysunix.c @@ -23,10 +23,15 @@ #include #include "editline.h" +#ifdef HAVE_TERMIOS_H #include +#else +#include +#endif RCSID("$Id$"); +#ifdef HAVE_TERMIOS_H void rl_ttyset(int Reset) { @@ -53,7 +58,26 @@ rl_ttyset(int Reset) else tcsetattr(0, TCSANOW, &old); } +#else /* !HAVE_TERMIOS_H */ +void +rl_ttyset(int Reset) +{ + static struct sgttyb old; + struct sgttyb new; + if (Reset == 0) { + ioctl(0, TIOCGETP, &old); + rl_erase = old.sg_erase; + rl_kill = old.sg_kill; + new = old; + new.sg_flags &= ~(ECHO | ICANON); + new.sg_flags &= ~(ISTRIP | INPCK); + ioctl(0, TIOCSETP, &new); + } else { + ioctl(0, TIOCSETP, &old); + } +} +#endif /* HAVE_TERMIOS_H */ void rl_add_slash(char *path, char *p)