File ispell-3.3.02-terminal.patch of Package ispell

---
 correct.c |    1 +
 ispell.h  |    5 +++++
 term.c    |   19 +++++++++++++++++++
 3 files changed, 25 insertions(+)

--- correct.c
+++ correct.c	2016-02-12 11:01:38.867627625 +0000
@@ -220,6 +220,7 @@ static char Rcs_Id[] =
 
 #include <ctype.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include "config.h"
 #include "ispell.h"
 #include "proto.h"
--- ispell.h
+++ ispell.h	2016-02-12 11:01:38.867627625 +0000
@@ -146,6 +146,7 @@
 
 #include "config.h"
 #include <stdio.h>
+#include <curses.h>
 
 #ifdef __STDC__
 #define P(x)	x
@@ -585,7 +586,11 @@ extern ichar_t	mytoupper P ((unsigned in
 # define EXTERN extern
 #endif
 
+#ifdef NCURSES_VERSION
+extern char *	BC;	/* backspace if not ^H */
+#else
 EXTERN char *	BC;	/* backspace if not ^H */
+#endif
 EXTERN char *	cd;	/* clear to end of display */
 EXTERN char *	cl;	/* clear display */
 EXTERN char *	cm;	/* cursor movement */
--- term.c
+++ term.c	2016-02-12 11:02:21.858794671 +0000
@@ -108,6 +108,7 @@ static char Rcs_Id[] =
 #endif
 #endif
 #include <signal.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 
@@ -209,9 +210,13 @@ void terminit ()
     int			tpgrp;
 #else
 #ifdef TIOCGPGRP
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+    pid_t		tpgrp;
+#else
     int			tpgrp;
 #endif
 #endif
+#endif
 #ifdef TIOCGWINSZ
     struct winsize	wsize;
 #endif /* TIOCGWINSZ */
@@ -315,7 +320,11 @@ retry:
 	(void) fprintf (stderr, TERM_C_NO_BATCH);
 	exit (1);
 	}
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+    (void) tcgetattr (0, &osbuf);
+#else
     (void) ioctl (0, TCGETA, (char *) &osbuf);
+#endif
     termchanged = 1;
 
     sbuf = osbuf;
@@ -324,7 +333,11 @@ retry:
     sbuf.c_iflag &= ~(INLCR | IGNCR | ICRNL);
     sbuf.c_cc[VMIN] = 1;
     sbuf.c_cc[VTIME] = 1;
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+    (void) tcsetattr (0, TCSADRAIN, &sbuf);
+#else
     (void) ioctl (0, TCSETAW, (char *) &sbuf);
+#endif
 
     uerasechar = osbuf.c_cc[VERASE];
     ukillchar = osbuf.c_cc[VKILL];
@@ -337,7 +350,11 @@ retry:
 #endif
 #endif
 #ifdef TIOCGPGRP
+#if defined(__GLIBC__) && __GLIBC__ >= 2
+    if ((tpgrp = tcgetpgrp (0)) == -1)
+#else
     if (ioctl (0, TIOCGPGRP, (char *) &tpgrp) != 0)
+#endif
 	{
 	(void) fprintf (stderr, TERM_C_NO_BATCH);
 	exit (1);
openSUSE Build Service is sponsored by