From 09f64367454b797a2b340d8390ff16d85d3a983a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 25 Oct 2010 18:32:38 +0000 Subject: [PATCH] Use realpath() in make_canonical to properly resolve symlinks --- dtool/src/dtoolutil/filename.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index dbfb3c82a8..315489e35c 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -1064,6 +1064,14 @@ make_canonical() { // The root directory is a special case. return true; } + +#ifndef WIN32 + // Use realpath in order to resolve symlinks properly + char newpath [PATH_MAX + 1]; + if (realpath(c_str(), newpath) != NULL) { + (*this) = newpath; + } +#endif Filename cwd = ExecutionEnvironment::get_cwd(); if (!r_make_canonical(cwd)) {