diff options
Diffstat (limited to 'chat/icb/patches/patch-av')
-rw-r--r-- | chat/icb/patches/patch-av | 194 |
1 files changed, 185 insertions, 9 deletions
diff --git a/chat/icb/patches/patch-av b/chat/icb/patches/patch-av index 5f6ab9f520f..a69380e717d 100644 --- a/chat/icb/patches/patch-av +++ b/chat/icb/patches/patch-av @@ -1,12 +1,188 @@ -$NetBSD: patch-av,v 1.1 2005/12/14 13:53:24 joerg Exp $ +$NetBSD: patch-av,v 1.2 2008/12/17 02:19:59 christos Exp $ ---- icb/history.c.orig 2005-12-13 16:25:41.000000000 +0000 -+++ icb/history.c -@@ -19,7 +19,6 @@ static STRLIST *hp = (STRLIST *) 0; /* u - histput(nick) - char *nick; +--- icb/unix.c.orig 1995-02-24 16:20:31.000000000 -0500 ++++ icb/unix.c 2008-12-16 21:16:10.000000000 -0500 +@@ -7,20 +7,26 @@ + #include <stdio.h> + #include "icb.h" + #include "externs.h" ++#include <limits.h> + #include <pwd.h> + #include <sys/dir.h> + + #undef stty + #undef gtty + +-#ifndef SYSV +- + #ifdef linux + #include <bsd/sgtty.h> + #else + #include <sgtty.h> + #endif + ++#if defined(__linux__) || defined(__NetBSD__) ++#include <termios.h> ++#define TTYSTRUCT termios ++#define stty(fd,buf) tcsetattr((fd),TCSANOW,(buf)) ++#define gtty(fd,buf) tcgetattr((fd),(buf)) ++#else ++#ifndef SYSV + #define TTYSTRUCT sgttyb + #define stty(fd,buf) ioctl((fd),TIOCSETN,(buf)) + #define gtty(fd,buf) ioctl((fd),TIOCGETP,(buf)) +@@ -30,6 +36,7 @@ + #define stty(fd,buf) ioctl((fd),TCSETA,(buf)) + #define gtty(fd,buf) ioctl((fd),TCGETA,(buf)) + #endif /* SYSV */ ++#endif /* TIOCSETA */ + + char *getlogin(); + +@@ -65,13 +72,16 @@ + + /* set line buffering for an open file pointer */ + /* output will be flushed every newline */ ++static char buf[1024]; + + linebuffer(fp) + FILE *fp; + { +-#ifndef SYSV ++#ifndef _IOLBF ++ setvbuf(fp, buf, _IOLBF, sizeof(buf)); ++#else + setlinebuf(fp); +-#endif /* SYSV */ ++#endif + } + + +@@ -79,13 +89,13 @@ + pushback(c) + char c; + { +-#ifndef SYSV ++#ifdef TIOCSTI + if (ioctl(0, TIOCSTI, &c) < 0) + perror("TIOCSTI ioctl failed"); +-#else /* SYSV */ ++#else + if (ungetc(c,stdin) == EOF) + perror("ungetc() failed"); +-#endif /* SYSV */ ++#endif + } + + +@@ -94,25 +104,25 @@ + + getterm() { -- char *malloc(); - STRLIST *sp; +-#ifndef SYSV ++#if !defined(TCSETA) && !defined(TCSANOW) + struct ltchars lt; +-#endif /* SYSV */ ++#endif + /* get tty settings */ + if (gtty(0,&origtty) < 0) { + badttyinfo++; + ttyinfo.erase = '\b'; /* ^H */ + ttyinfo.kill = '\025'; /* ^U */ + } else { +-#ifndef SYSV +- ttyinfo.erase = origtty.sg_erase; +- ttyinfo.kill = origtty.sg_kill; +-#else /* SYSV */ ++#if defined(TCSETA) || defined(TCSANOW) + ttyinfo.erase = origtty.c_cc[VERASE]; + ttyinfo.kill = origtty.c_cc[VKILL]; +-#endif /* SYSV */ ++#else ++ ttyinfo.erase = origtty.sg_erase; ++ ttyinfo.kill = origtty.sg_kill; ++#endif + } + +-#ifndef SYSV ++#if !defined(TCSETA) && !defined(TCSANOW) + /* get local special chars */ + if (ioctl(0, TIOCGLTC, <) < 0) { + ttyinfo.redraw = '\022'; /* ^R */ +@@ -121,10 +131,10 @@ + ttyinfo.redraw = lt.t_rprntc; + ttyinfo.werase = lt.t_werasc; + } +-#else /* SYSV */ ++#else + ttyinfo.redraw = '\022'; /* ^R */ + ttyinfo.werase = '\027'; /* ^W */ +-#endif /* SYSV */ ++#endif + + /* get the current window size */ + getwinsize(); +@@ -145,14 +155,14 @@ + bcopy((char *)&origtty, (char *)&tty, (unsigned)sizeof(struct TTYSTRUCT)); + + /* turn on cbreak - turn off echo */ +-#ifndef SYSV +- tty.sg_flags |= CBREAK; +- tty.sg_flags &= ~ECHO; +-#else /* SYSV */ ++#if defined(TCSETA) || defined(TCSANOW) + tty.c_lflag &= ~ICANON; + tty.c_cc[VEOF] = 1; + tty.c_lflag &= ~ECHO; +-#endif /* SYSV */ ++#else ++ tty.sg_flags |= CBREAK; ++ tty.sg_flags &= ~ECHO; ++#endif + + echomode = 0; + /* set the new flags */ +@@ -206,7 +216,11 @@ + struct passwd *pw; + char login[17]; + char *p = login; ++#ifdef NAME_MAX ++ static char path[NAME_MAX + 1]; ++#else + static char path[MAXNAMLEN+1]; ++#endif + + /* has to start with a tilde */ + if (*s++ != '~') +@@ -258,11 +272,11 @@ + } + + /* turn on echo */ +-#ifndef SYSV +- tty.sg_flags |= ECHO; +-#else /* SYSV */ ++#if defined(TCSETA) || defined(TCSANOW) + tty.c_lflag |= ECHO; +-#endif /* SYSV */ ++#else ++ tty.sg_flags |= ECHO; ++#endif + + echomode = 1; + +@@ -287,11 +301,11 @@ + } + + /* turn off echo */ +-#ifndef SYSV +- tty.sg_flags &= ~ECHO; +-#else /* SYSV */ ++#if defined(TCSETA) || defined(TCSANOW) + tty.c_lflag &= ~ECHO; +-#endif /* SYSV */ ++#else ++ tty.sg_flags &= ~ECHO; ++#endif + + echomode = 0; - /* hunt for user within list */ |