Allow the display of '%'. Also combine the two patches for

bpatch.c while I'm here.

PR:		6867
Submitted by:	Luoqi Chen <luoqi@chen.ml.org>
This commit is contained in:
Steve Price 1998-07-04 19:05:14 +00:00
parent dfaf346273
commit 1ba10c29a0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=11707

View file

@ -1,5 +1,5 @@
--- bpatch.c.orig Wed Jan 17 15:33:33 1990 --- bpatch.c.orig Sat Jul 4 12:12:02 1998
+++ bpatch.c Mon Mar 18 19:23:16 1996 +++ bpatch.c Sat Jul 4 12:13:22 1998
@@ -90,10 +90,15 @@ @@ -90,10 +90,15 @@
/*E*/ /*E*/
/*S includes, globals, and defines */ /*S includes, globals, and defines */
@ -64,7 +64,21 @@
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/* set up signal handling */ /* set up signal handling */
@@ -339,13 +335,13 @@ @@ -333,19 +329,27 @@
alphawin = subwin (stdscr, 16, 16, 4, 57);
keypad (alphawin, TRUE);
errwin = subwin (stdscr, 1, 80, 23, 0);
+ if (errwin == NULL)
+ errwin = stdscr;
+ if (hexwin == NULL || alphawin == NULL)
+ {
+ fprintf(stderr, "Can't create all necessary curses windows.\n");
+ reset (0);
+ exit (2);
+ }
#ifdef MOD_HAX
/* This is not exactly what the original code does,
but it's good enough. -r$ */ but it's good enough. -r$ */
raw(); raw();
#else /* use original code... */ #else /* use original code... */
@ -80,7 +94,7 @@
#endif /* MOD_HAX */ #endif /* MOD_HAX */
} }
@@ -478,7 +474,9 @@ @@ -478,7 +482,9 @@
} }
pbrk = 0; pbrk = 0;
fprintf (stderr, "\007"); fprintf (stderr, "\007");
@ -91,7 +105,7 @@
if (pbrk) status = EOF; if (pbrk) status = EOF;
} }
@@ -832,7 +830,8 @@ @@ -832,7 +838,8 @@
touchwin (alphawin); touchwin (alphawin);
wrefresh (alphawin); wrefresh (alphawin);
@ -101,7 +115,7 @@
{ {
if (!arrow (z, &r, &c)) if (!arrow (z, &r, &c))
{ {
@@ -902,7 +901,8 @@ @@ -902,7 +909,8 @@
touchwin (hexwin); touchwin (hexwin);
wrefresh (hexwin); wrefresh (hexwin);
@ -111,7 +125,7 @@
{ {
if (!arrow (z, &r, &c)) if (!arrow (z, &r, &c))
{ {
@@ -1281,7 +1281,7 @@ @@ -1281,7 +1289,7 @@
/*S breakp - set pbrk on interrupt */ /*S breakp - set pbrk on interrupt */
/*H breakp */ /*H breakp */
/*E*/ /*E*/
@ -120,7 +134,7 @@
int i; int i;
{ {
int s; int s;
@@ -1592,6 +1592,7 @@ @@ -1592,6 +1600,7 @@
/*S reset - reset terminal to original state */ /*S reset - reset terminal to original state */
/*H reset */ /*H reset */
/*E*/ /*E*/
@ -128,7 +142,7 @@
reset (sig) reset (sig)
int sig; int sig;
{ {
@@ -1600,7 +1601,7 @@ @@ -1600,7 +1609,7 @@
move (23, 0); move (23, 0);
refresh (); refresh ();
#ifndef MOD_HAX #ifndef MOD_HAX
@ -137,7 +151,7 @@
#endif #endif
endwin (); endwin ();
} }
@@ -1610,7 +1611,6 @@ @@ -1610,7 +1619,6 @@
fprintf (stderr, "killed with signal %d\n", sig); fprintf (stderr, "killed with signal %d\n", sig);
exit (sig); exit (sig);
} }
@ -145,3 +159,14 @@
} }
/*S arrow - determine if current character is a cursor control key */ /*S arrow - determine if current character is a cursor control key */
/*H arrow */ /*H arrow */
@@ -1924,8 +1932,8 @@
outstr (fmt)
char *fmt;
{
- if (dump) printf (fmt);
- else printw (fmt);
+ if (dump) printf ("%s", fmt);
+ else printw ("%s", fmt);
return;
}