summaryrefslogtreecommitdiff
path: root/chat/i2cb/patches/patch-ag
blob: 88c39ea384a75488ab217c50696b35a5152149fd (plain)
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
$NetBSD: patch-ag,v 1.2 2005/12/13 21:30:11 joerg Exp $

--- src/tcl.c.orig	2000-03-15 22:28:26.000000000 +0000
+++ src/tcl.c
@@ -5,9 +5,11 @@
 
 #include "icb.h"
 #include "externs.h"
-#include <sys/dir.h>
+#include <sys/types.h>
+#include <dirent.h>
 #include <sys/file.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <unistd.h>
 
 void	tclinit (void);
@@ -72,7 +74,11 @@ void
 tclreadicbrc (void)
 {
 	char *path;
+#ifdef NAME_MAX
+	char cmd[NAME_MAX + 10];
+#else
 	char cmd[MAXNAMLEN+10];
+#endif
 	
 	if (!(path = getrcname())) return;
 
@@ -92,9 +98,13 @@ tclreadicbrc (void)
 static char *
 getrcname (void)
 {
-	static char *names[] = { ".icbrc", ".fnrc", ".tclrc" , (char *)NULL };
+	static char *names[] = { ".i2cbrc", ".icbrc", ".fnrc", ".tclrc" , (char *)NULL };
 	char *rcfile, *homedir, **p;
+#ifdef NAME_MAX
+	static char rcpath[NAME_MAX + 1];
+#else
 	static char rcpath[MAXNAMLEN+1];	/* path of startup file */
+#endif
 
 	/* get name of file to use */
 	if (((rcfile = getenv("ICBRC")) != NULL)