]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/sg_path.cxx
Ganael Laplanche: fix include dependencies for FreeBSD support
[simgear.git] / simgear / misc / sg_path.cxx
index e4b3cbf963500744fbed8994bef83f1b3f3458a4..d51c93afdf74c791746a33883a878db061a1c2a4 100644 (file)
@@ -490,6 +490,11 @@ std::string SGPath::realpath() const
     return path;
 #else
     char* buf = ::realpath(path.c_str(), NULL);
+    if (!buf)
+    {
+        SG_LOG(SG_IO, SG_ALERT, "ERROR: The path '" << path << "' does not exist in the file system.");
+        return path;
+    }
     std::string p(buf);
     free(buf);
     return p;