2013-09-26 17:14:40 +02:00

50 lines
986 B
Plaintext

$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)