improve executable search.

This commit is contained in:
U-vsc-PC\vsc
2014-03-04 12:00:13 +00:00
parent f8f2376394
commit ec8f12d38b
3 changed files with 48 additions and 8 deletions

View File

@@ -30,7 +30,13 @@
char *
Yap_FindExecutable(void)
{
return "yap";
enum { BUFFERSIZE = 1024 };
char *buf = malloc(BUFFERSIZE);
if (!GetModuleFileName(NULL, buf, BUFFERSIZE-1))
return NULL;
return buf;
}
void *