21320c5685
- no errno, use errno.h - no redefinition of function parameters as local variables [how did this ever work?!] - malloc comes from stdlib.h - NAME_MAX is prefered when available, it is POSIX - strchr, strpbrk, strspn, strstr, strtol and strtoul can and should be used from libc. - remove tcl version of string.h, system header is good enough (and if it doesn't have index, it would have been broken anyway)
36 lines
782 B
Text
36 lines
782 B
Text
$NetBSD: patch-ba,v 1.1 2005/12/14 13:53:24 joerg Exp $
|
|
|
|
--- icb/tcl.c.orig 1995-02-24 21:20:30.000000000 +0000
|
|
+++ icb/tcl.c
|
|
@@ -3,6 +3,7 @@
|
|
|
|
/* TCL interface */
|
|
|
|
+#include <limits.h>
|
|
#ifdef linux
|
|
#include <unistd.h>
|
|
#endif
|
|
@@ -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)
|