Merge branch 'for-slava' of git://git.rfc1149.net/factor

db4
Slava Pestov 2009-10-05 18:29:31 -05:00
commit 36c1fcdbe8
2 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@ const char *default_image_path()
char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1];
memcpy(new_path,path,len + 1);
memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
free(const_cast<char *>(path));
return new_path;
}

View File

@ -3,7 +3,7 @@
namespace factor
{
/* Snarfed from SBCL linux-so.c. You must delete[] the result yourself. */
/* Snarfed from SBCL linux-so.c. You must free() the result yourself. */
const char *vm_executable_path()
{
char *path = new char[PATH_MAX + 1];
@ -17,7 +17,10 @@ const char *vm_executable_path()
else
{
path[size] = '\0';
return safe_strdup(path);
const char *ret = safe_strdup(path);
delete[] path;
return ret;
}
}