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
66
67
68
69
|
$NetBSD: patch-ai,v 1.2 2003/11/07 16:35:51 christos Exp $
--- fep_hist.c.orig 1988-11-25 06:45:42.000000000 -0500
+++ fep_hist.c 2003-11-07 11:20:24.000000000 -0500
@@ -3,9 +3,11 @@
#ifndef lint
static char rcsid[]=
"$Header: /cvsroot/pkgsrc/misc/fep/patches/patch-ai,v 1.2 2003/11/07 16:35:51 christos Exp $ (SRA)";
-#endif lint
+#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';
|