From: ceriel Date: Tue, 9 Oct 1984 11:43:19 +0000 (+0000) Subject: The routine findpath did not work. It used the same static buffer for X-Git-Tag: release-5-5~6053 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a33d4cdbba19763d1adb0130d75009ccbfdfee93;p=ack.git The routine findpath did not work. It used the same static buffer for several calls. Now it uses alloc. --- diff --git a/util/LLgen/src/machdep.c b/util/LLgen/src/machdep.c index 409d04ffb..6ca3745ae 100644 --- a/util/LLgen/src/machdep.c +++ b/util/LLgen/src/machdep.c @@ -59,11 +59,16 @@ string libpath(s) string s; { /* Must deliver a full pathname to the library file "s" */ - static char buf[100]; + register string p; + register length; + p_mem alloc(); string strcpy(), strcat(); + static string subdir = "/lib/LLgen/"; - strcpy(buf,EM_DIR); - strcat(buf,"/lib/LLgen/"); - strcat(buf,s); - return buf; + length = strlen(EM_DIR) + strlen(subdir) + strlen(s) + 1; + p = (string) alloc((unsigned) length); + strcpy(p,EM_DIR); + strcat(p,subdir); + strcat(p,s); + return p; }