1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
$NetBSD: patch-ai,v 1.3 2003/11/11 10:42:32 wiz Exp $
--- fep_hist.c.orig Fri Nov 25 12:45:42 1988
+++ fep_hist.c
@@ -6,6 +6,8 @@ static char rcsid[]=
#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 @@ historyExtract(string)
default:
{
- char *buf[64];
+ char buf[64];
strcpy (buf, "^");
strncat (buf, string, 64);
@@ -267,6 +269,7 @@ historyExtract(string)
char *
search_reverse_history (string)
+ char *string;
{
register int i;
char *re_comp();
@@ -291,6 +294,7 @@ search_reverse_history (string)
char *
search_forward_history (string)
+ char *string;
{
register int i;
char *re_comp();
@@ -412,7 +416,7 @@ char *
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 @@ read_history (file)
char *file;
{
FILE *fp;
- char line [MAXCOMLEN];
+ char line [MAXCMDLEN];
register int i;
if ((fp = fopen (file, "r")) == NULL) {
@@ -550,7 +554,7 @@ read_history (file)
return;
}
- while (fgets (line, MAXCOMLEN, fp)) {
+ while (fgets (line, MAXCMDLEN, fp)) {
i = strlen (line) - 1;
if (line [i] == '\n')
line [i] = '\0';
|