about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/Src/init.c b/Src/init.c
index 02749cc0a..341173889 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -1020,22 +1020,18 @@ source(char *s)
 void
 sourcehome(char *s)
 {
-    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;
+
+    {
+	/* Let source() complain if path is too long */
+	VARARR(char, buf, strlen(h) + strlen(s) + 2);
+	sprintf(buf, "%s/%s", h, s);
+	source(buf);
     }
-#endif
-    buf = tricat(h, "/", s);
-    source(buf);
-    zsfree(buf);
 }
 
 /**/