Replace alloca with malloc for win32 builds.

This commit is contained in:
Tony Tyson 2000-04-28 02:52:00 +00:00
parent 3d58770b4e
commit 341eacbc53

View file

@ -838,10 +838,16 @@ COM_AddDirectory (char *dir)
printf("%p\n",pwd_ent);
} else
#endif
home = getenv("HOME");
home = getenv("HOME");
if (home) {
if (home)
{
#if !defined(_WIN32)
tmp = alloca(strlen(home)+strlen(dir));
#else
tmp = malloc(strlen(home)+strlen(dir));
#endif
strcpy (tmp, home);
strcat (tmp, dir+1); // skip leading ~
dir=tmp;