summaryrefslogtreecommitdiff
path: root/Src/init.c
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-09-16 18:57:45 +0000
committerClint Adams <clint@users.sourceforge.net>2000-09-16 18:57:45 +0000
commit2742cb14ce02354f6c9a2a2a61f793f9a1932924 (patch)
tree7c098832770e48dcc5d4c2cb27c32ed464fb3720 /Src/init.c
parent73e23c7999196642fcf3448013b4e37b03044e8c (diff)
downloadzsh-2742cb14ce02354f6c9a2a2a61f793f9a1932924.tar.gz
zsh-2742cb14ce02354f6c9a2a2a61f793f9a1932924.zip
12814: zasprintf
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Src/init.c b/Src/init.c
index e3e8f734e..0c82e47ef 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1020,18 +1020,22 @@ source(char *s)
void
sourcehome(char *s)
{
- char buf[PATH_MAX];
+ char *buf;
char *h;
if (emulation == EMULATE_SH || emulation == EMULATE_KSH ||
!(h = getsparam("ZDOTDIR")))
h = home;
+/* Let source() complain if it's too long */
+#if 0
if (strlen(h) + strlen(s) + 1 >= PATH_MAX) {
zerr("path too long: %s", s, 0);
return;
}
- sprintf(buf, "%s/%s", h, s);
+#endif
+ zasprintf(&buf, "%s/%s", h, s);
source(buf);
+ zsfree(buf);
}
/**/