mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-15 23:50:44 +00:00
60 lines
1.2 KiB
Plaintext
60 lines
1.2 KiB
Plaintext
|
*** monitor.c.orig Tue Apr 22 20:58:59 1997
|
||
|
--- monitor.c Tue Apr 22 21:13:57 1997
|
||
|
***************
|
||
|
*** 1,3 ****
|
||
|
--- 1,8 ----
|
||
|
+ /*
|
||
|
+ Patched by Joel Sutton 22nd April, 1997
|
||
|
+ Replaced gets with fgets. Added a newline chop feature.
|
||
|
+ */
|
||
|
+
|
||
|
#include <stdio.h>
|
||
|
#include <ctype.h>
|
||
|
#include <unistd.h>
|
||
|
***************
|
||
|
*** 95,106 ****
|
||
|
|
||
|
printf ("> ");
|
||
|
fflush(stdout);
|
||
|
! if (gets (s) == NULL)
|
||
|
{
|
||
|
printf("\n> CONT\n");
|
||
|
strcpy(s, "CONT");
|
||
|
}
|
||
|
|
||
|
for (p=0;s[p]!=0;p++)
|
||
|
if (islower(s[p]))
|
||
|
s[p] = toupper(s[p]);
|
||
|
--- 100,113 ----
|
||
|
|
||
|
printf ("> ");
|
||
|
fflush(stdout);
|
||
|
! if (fgets (s,256,stdin) == NULL)
|
||
|
{
|
||
|
printf("\n> CONT\n");
|
||
|
strcpy(s, "CONT");
|
||
|
}
|
||
|
|
||
|
+ s[strlen(s)-1]='\0'; /* fgets provision */
|
||
|
+
|
||
|
for (p=0;s[p]!=0;p++)
|
||
|
if (islower(s[p]))
|
||
|
s[p] = toupper(s[p]);
|
||
|
***************
|
||
|
*** 186,192 ****
|
||
|
char gash[4];
|
||
|
|
||
|
printf ("Press return to continue: ");
|
||
|
! gets (gash);
|
||
|
nlines = 0;
|
||
|
}
|
||
|
}
|
||
|
--- 193,199 ----
|
||
|
char gash[4];
|
||
|
|
||
|
printf ("Press return to continue: ");
|
||
|
! fgets (gash,256,stdin);
|
||
|
nlines = 0;
|
||
|
}
|
||
|
}
|