mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
PATH_MAX is not guaranteed by POSIX (fixes bug #6906).
Patch from Samuel Thibault. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35452 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0b17cb1135
commit
1291b07c05
@ -297,9 +297,16 @@ bool autoOpenFile(string const & filename, auto_open_mode const mode)
|
||||
|
||||
string real_path(string const & path)
|
||||
{
|
||||
#ifdef __GLIBC__
|
||||
char * result = realpath(path.c_str(), NULL);
|
||||
string ret = FileName::fromFilesystemEncoding(result ? result : path).absFileName();
|
||||
free(result);
|
||||
return ret;
|
||||
#else
|
||||
char rpath[PATH_MAX + 1];
|
||||
char * result = realpath(path.c_str(), rpath);
|
||||
return FileName::fromFilesystemEncoding(result ? rpath : path).absFileName();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace os
|
||||
|
Loading…
Reference in New Issue
Block a user