getcwd() => Get_current_directory()

This commit is contained in:
Thomas Bernard
2018-02-12 11:24:23 +01:00
parent 2ef2e04a7e
commit 62944c724e
4 changed files with 26 additions and 40 deletions

View File

@@ -2,6 +2,7 @@
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2018 Thomas Bernard
Copyright 2011 Pawel Góralski
Copyright 2008 Yves Rizoud
Copyright 2007 Adrien Destugues
@@ -524,3 +525,18 @@ void Release_lock_file(const char *file_directory)
strcat(lock_filename,"gfx2.lck");
remove(lock_filename);
}
const char * Get_current_directory(char * buf, size_t size)
{
#if defined(__MINT__)
buf[0] = 'A'+Dgetdrv();
buf[1] = ':';
buf[2] = '\\';
Dgetpath(buf+3,0);
strcat(buf,PATH_SEPARATOR);
return buf;
#else
return getcwd(buf, size);
#endif
}