76 lines
1.6 KiB
Text
76 lines
1.6 KiB
Text
$NetBSD: patch-ab,v 1.3 2006/05/16 18:43:45 christos Exp $
|
|
|
|
--- qsubst.c.orig 2001-04-22 01:35:35.000000000 -0400
|
|
+++ qsubst.c 2006-05-16 14:39:11.923906738 -0400
|
|
@@ -105,7 +105,7 @@
|
|
#include <signal.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
-#include <strings.h>
|
|
+#include <string.h>
|
|
#include <termcap.h>
|
|
#include <termios.h>
|
|
#include <unistd.h>
|
|
@@ -148,12 +148,23 @@
|
|
static void tstp_self(void)
|
|
{
|
|
void (*old_tstp)(int);
|
|
+#ifndef SIG_BLOCK
|
|
int mask;
|
|
|
|
mask = sigblock(0);
|
|
+#else
|
|
+ sigset_t set, oset;
|
|
+ sigemptyset(&set);
|
|
+ sigprocmask(SIG_BLOCK, &set, &oset);
|
|
+#endif
|
|
kill(getpid(),SIGTSTP);
|
|
old_tstp = signal(SIGTSTP,SIG_DFL);
|
|
+#ifndef SIG_BLOCK
|
|
sigsetmask(mask&~sigmask(SIGTSTP));
|
|
+#else
|
|
+ sigdelset(&oset, SIGTSTP);
|
|
+ sigprocmask(SIG_SETMASK, &set, &oset);
|
|
+#endif
|
|
signal(SIGTSTP,old_tstp);
|
|
}
|
|
|
|
@@ -166,9 +177,9 @@
|
|
{ tstp_self();
|
|
return;
|
|
}
|
|
- tcsetattr(0,TCSAFLUSH|TCSASOFT,&orig_tio);
|
|
+ tcsetattr(0,TCSAFLUSH,&orig_tio);
|
|
tstp_self();
|
|
- tcsetattr(0,TCSADRAIN|TCSASOFT,&tio);
|
|
+ tcsetattr(0,TCSADRAIN,&tio);
|
|
}
|
|
|
|
static void limit_above_below(void)
|
|
@@ -181,7 +192,7 @@
|
|
}
|
|
}
|
|
|
|
-static int issymchar(char c)
|
|
+static int issymchar(unsigned char c)
|
|
{
|
|
return( isascii(c) &&
|
|
( isalnum(c) ||
|
|
@@ -231,7 +242,7 @@
|
|
tio.c_lflag &= ~(ICANON|ECHOKE|ECHOE|ECHO|ECHONL);
|
|
tio.c_cc[VMIN] = 1;
|
|
tio.c_cc[VTIME] = 0;
|
|
- tcsetattr(0,TCSANOW|TCSASOFT,&tio);
|
|
+ tcsetattr(0,TCSANOW,&tio);
|
|
switch (read(0,&c,1))
|
|
{ case -1:
|
|
break;
|
|
@@ -240,7 +251,7 @@
|
|
case 1:
|
|
break;
|
|
}
|
|
- tcsetattr(0,TCSANOW|TCSASOFT,&otio);
|
|
+ tcsetattr(0,TCSANOW,&otio);
|
|
return(c);
|
|
}
|
|
|