summaryrefslogtreecommitdiff
path: root/textproc/ispell-base/patches
diff options
context:
space:
mode:
authorwiz <wiz>2001-03-16 11:05:46 +0000
committerwiz <wiz>2001-03-16 11:05:46 +0000
commitf05bf164bbaacc8d88ca9669e2009984d35b2aa1 (patch)
tree2b2149d29e54eedb3d103c7d79fb0c2c05aab812 /textproc/ispell-base/patches
parent75e4219addb1c1373222a5a9cb7a3964bd25828a (diff)
downloadpkgsrc-f05bf164bbaacc8d88ca9669e2009984d35b2aa1.tar.gz
Use termios instead of TIOC{G,S}ETP, so that ispell works on machines
without COMPAT_43 in the kernel.
Diffstat (limited to 'textproc/ispell-base/patches')
-rw-r--r--textproc/ispell-base/patches/patch-ak147
1 files changed, 147 insertions, 0 deletions
diff --git a/textproc/ispell-base/patches/patch-ak b/textproc/ispell-base/patches/patch-ak
new file mode 100644
index 00000000000..b4bbb60f678
--- /dev/null
+++ b/textproc/ispell-base/patches/patch-ak
@@ -0,0 +1,147 @@
+$NetBSD: patch-ak,v 1.1 2001/03/16 11:05:46 wiz Exp $
+
+--- term.c.orig Wed Nov 2 19:44:28 1994
++++ term.c
+@@ -64,7 +64,10 @@
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+-#ifdef USG
++#ifdef __NetBSD__
++#define USE_TERMIOS
++#include <termios.h>
++#elif defined(USG)
+ #include <termio.h>
+ #else
+ #include <sgtty.h>
+@@ -135,7 +138,10 @@
+ return putchar (c);
+ }
+
+-#ifdef USG
++#ifdef USE_TERMIOS
++static struct termios sbuf;
++static struct termios osbuf;
++#elif defined(USG)
+ static struct termio sbuf;
+ static struct termio osbuf;
+ #else
+@@ -263,8 +269,31 @@
+
+ #endif
+
++#ifdef USE_TERMIOS
++ if (!isatty (0))
++ {
++ (void) fprintf (stderr, TERM_C_NO_BATCH);
++ exit (1);
++ }
++ tcgetattr(0, &osbuf);
++ termchanged = 1;
++
++ sbuf = osbuf;
++ sbuf.c_lflag &= ~(ECHO | ECHOK | ECHONL | ICANON);
++ sbuf.c_oflag &= ~(OPOST);
++ sbuf.c_iflag &= ~(INLCR | IGNCR | ICRNL);
++ sbuf.c_lflag |= ISIG;
++ sbuf.c_cc[VMIN] = 1;
++ sbuf.c_cc[VTIME] = 0;
++ tcsetattr(0, TCSANOW, &sbuf);
++
++ uerasechar = osbuf.c_cc[VERASE];
++ ukillchar = osbuf.c_cc[VKILL];
++
++#endif
++
+ #ifdef SIGTSTP
+-#ifndef USG
++#if !(defined(USG) || defined(USE_TERMIOS))
+ (void) sigsetmask (1<<(SIGTSTP-1) | 1<<(SIGTTIN-1) | 1<<(SIGTTOU-1));
+ #endif
+ #endif
+@@ -290,7 +319,7 @@
+ #endif
+ #endif
+
+-#ifndef USG
++#if !(defined(USG) || defined(USE_TERMIOS))
+ (void) ioctl (0, TIOCGETP, (char *) &osbuf);
+ #ifdef TIOCGLTC
+ (void) ioctl (0, TIOCGLTC, (char *) &oltc);
+@@ -343,7 +372,9 @@
+ {
+ if (te)
+ tputs (te, 1, putch);
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &osbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+@@ -359,7 +390,9 @@
+ static SIGNAL_TYPE onstop (signo)
+ int signo;
+ {
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &osbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+@@ -374,7 +407,9 @@
+ (void) kill (0, signo);
+ /* stop here until continued */
+ (void) signal (signo, onstop);
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &sbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &sbuf);
+@@ -434,7 +469,9 @@
+ }
+ argv[i] = NULL;
+
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &osbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+@@ -480,7 +517,9 @@
+ (void) signal (SIGTSTP, onstop);
+ #endif
+
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &sbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &sbuf);
+@@ -513,7 +552,9 @@
+ int ch;
+ #endif
+
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &osbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+@@ -545,7 +586,9 @@
+ (void) signal (SIGTSTP, onstop);
+ #endif
+
+-#ifdef USG
++#ifdef USE_TERMIOS
++ tcsetattr(0, TCSANOW, &sbuf);
++#elif defined(USG)
+ (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #else
+ (void) ioctl (0, TIOCSETP, (char *) &sbuf);