From da86a1c9f2170a58b82f9a6de7b766d284a89446 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 13 Feb 2017 18:11:22 -0500 Subject: [PATCH] Fix previous commit warning --- src/V3Os.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/V3Os.cpp b/src/V3Os.cpp index 1e18a4f98..44e9238bc 100644 --- a/src/V3Os.cpp +++ b/src/V3Os.cpp @@ -147,8 +147,11 @@ string V3Os::filenameRealPath(const string& filename) { // Get rid of all the ../ behavior in the middle of the paths. // If there is a ../ that goes down from the 'root' of this path it is preserved. char retpath[PATH_MAX]; - realpath(filename.c_str(), retpath); - return string(retpath); + if (realpath(filename.c_str(), retpath)) { + return string(retpath); + } else { + return filename; + } } bool V3Os::filenameIsRel(const string& filename) {