45 lines
1021 B
Plaintext
45 lines
1021 B
Plaintext
$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)
|