pkgsrc/chat/icb/patches/patch-au
2012-02-16 13:50:52 +00:00

45 lines
988 B
Text

$NetBSD: patch-au,v 1.5 2012/02/16 14:13:15 hans Exp $
--- icb/tcl.c.orig 1995-02-24 16:20:30.000000000 -0500
+++ icb/tcl.c 2008-12-16 20:18:01.000000000 -0500
@@ -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;
@@ -95,7 +96,11 @@ tclinit()
tclreadicbrc()
{
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)