diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2000-09-18 06:50:54 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2000-09-18 06:50:54 +0000 |
commit | fcaa17f39682f6f85fd6067302ed0d254019c79e (patch) | |
tree | 447140c9a6ebf3589861ca2d549fe72d0a6bfe02 /Src/init.c | |
parent | 25747f7d599f42c1ac2c33790b0a5f8080f12a87 (diff) | |
download | zsh-fcaa17f39682f6f85fd6067302ed0d254019c79e.tar.gz zsh-fcaa17f39682f6f85fd6067302ed0d254019c79e.tar.xz zsh-fcaa17f39682f6f85fd6067302ed0d254019c79e.zip |
Improve upon some of the PATH_MAX changes.
Diffstat (limited to 'Src/init.c')
-rw-r--r-- | Src/init.c | 16 |
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); } /**/ |