summaryrefslogtreecommitdiff
path: root/chat/icb/patches/patch-au
blob: be3a92ca32840e38cce5649a40f0bb14da1c6fe7 (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
45
46
47
48
49
$NetBSD: patch-au,v 1.6 2013/01/11 13:24:32 joerg Exp $

--- icb/tcl.c.orig	1995-02-24 21:20:30.000000000 +0000
+++ icb/tcl.c
@@ -3,13 +3,14 @@
 
 /* TCL interface */
 
-#ifdef linux
+#include <limits.h>
+#if defined(linux) || defined(__sun)
 #include <unistd.h>
 #endif
 
 #include "icb.h"
 #include "externs.h"
-#include <sys/dir.h>
+#include <dirent.h>
 #include <sys/file.h>
 
 Tcl_Interp *interp;
@@ -92,10 +93,14 @@ tclinit()
 
 }
 
-tclreadicbrc()
+void tclreadicbrc(void)
 {
 	char *p, *path;
+#ifdef NAME_MAX
+	char cmd[NAME_MAX + 10];
+#else
 	char cmd[MAXNAMLEN+10];
+#endif
 	
 	if (!(path = getrcname())) return;
 
@@ -117,7 +122,11 @@ getrcname()
 {
 	static char *names[] = { ".icbrc", ".fnrc", ".tclrc" , (char *)NULL };
 	char *rcfile, *homedir, *getenv(), **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)