51d52004ea
- modernize - use termios
65 lines
1.2 KiB
Text
65 lines
1.2 KiB
Text
$NetBSD: patch-ai,v 1.1 2000/02/07 03:18:13 christos Exp $
|
|
|
|
--- fep_hist.c.orig Fri Nov 25 06:45:42 1988
|
|
+++ fep_hist.c Sun Feb 6 21:08:02 2000
|
|
@@ -6,6 +6,8 @@
|
|
#endif lint
|
|
|
|
#include <stdio.h>
|
|
+#include <stdlib.h>
|
|
+#include <unistd.h>
|
|
#include <ctype.h>
|
|
#include "fep_defs.h"
|
|
#include "fep_glob.h"
|
|
@@ -255,7 +257,7 @@
|
|
|
|
default:
|
|
{
|
|
- char *buf[64];
|
|
+ char buf[64];
|
|
|
|
strcpy (buf, "^");
|
|
strncat (buf, string, 64);
|
|
@@ -267,6 +269,7 @@
|
|
|
|
char *
|
|
search_reverse_history (string)
|
|
+ char *string;
|
|
{
|
|
register int i;
|
|
char *re_comp();
|
|
@@ -291,6 +294,7 @@
|
|
|
|
char *
|
|
search_forward_history (string)
|
|
+ char *string;
|
|
{
|
|
register int i;
|
|
char *re_comp();
|
|
@@ -412,7 +416,7 @@
|
|
mk_home_relative (cp)
|
|
char *cp;
|
|
{
|
|
- char buf[256];
|
|
+ static char buf[256];
|
|
|
|
/*
|
|
* If variable "history-file" is not absolute path name,
|
|
@@ -540,7 +544,7 @@
|
|
char *file;
|
|
{
|
|
FILE *fp;
|
|
- char line [MAXCOMLEN];
|
|
+ char line [MAXCMDLEN];
|
|
register int i;
|
|
|
|
if ((fp = fopen (file, "r")) == NULL) {
|
|
@@ -550,7 +554,7 @@
|
|
return;
|
|
}
|
|
|
|
- while (fgets (line, MAXCOMLEN, fp)) {
|
|
+ while (fgets (line, MAXCMDLEN, fp)) {
|
|
i = strlen (line) - 1;
|
|
if (line [i] == '\n')
|
|
line [i] = '\0';
|