mirror of https://github.com/stella-emu/stella.git
Oops, get_current_dir_name() isn't available outside Linux; it even
says so in the documentation. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2508 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
f60524770a
commit
c63117c38d
|
@ -162,10 +162,13 @@ POSIXFilesystemNode::POSIXFilesystemNode(const string& p, bool verify)
|
|||
else if ((p.length() >= 2 && p[0] == '.' && p[1] == '/') ||
|
||||
(p.length() >= 1 && p[0] != '/'))
|
||||
{
|
||||
char* cwd = get_current_dir_name();
|
||||
#ifdef MAXPATHLEN
|
||||
char buf[MAXPATHLEN];
|
||||
const char* cwd = getcwd(buf, MAXPATHLEN);
|
||||
if (cwd != NULL && strlen(cwd) < MAXPATHLEN)
|
||||
#else // No MAXPATHLEN, as happens on Hurd
|
||||
char buf[1024];
|
||||
const char* cwd = getcwd(buf, 1024);
|
||||
if (cwd != NULL)
|
||||
#endif
|
||||
{
|
||||
|
@ -177,7 +180,6 @@ POSIXFilesystemNode::POSIXFilesystemNode(const string& p, bool verify)
|
|||
else
|
||||
_path = _path + '/' + p;
|
||||
}
|
||||
free(cwd);
|
||||
}
|
||||
else
|
||||
_path = p;
|
||||
|
|
Loading…
Reference in New Issue