From fcaa17f39682f6f85fd6067302ed0d254019c79e Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 18 Sep 2000 06:50:54 +0000 Subject: Improve upon some of the PATH_MAX changes. --- Src/init.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'Src/init.c') 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); } /**/ -- cgit 1.4.1