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
@@ -204,6 +204,7 @@ static char Rcs_Id[] =
*/
#include <ctype.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
@@ -143,6 +143,7 @@
#include "config.h"
#include <stdio.h>
+#include <curses.h>
#ifdef __STDC__
#define P(x) x
@@ -575,7 +576,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
@@ -99,6 +99,9 @@ static char Rcs_Id[] =
#endif
#endif
#include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
void ierase P ((void));
void imove P ((int row, int col));
@@ -198,9 +201,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 */
@@ -304,7 +311,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;
@@ -313,7 +324,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];
@@ -326,7 +341,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);