]> git.lyx.org Git - lyx.git/blobdiff - src/support/Package.cpp
Fix Coverity false positive for null-pointer dereference
[lyx.git] / src / support / Package.cpp
index 8b6fa0b03ae8becd97c3bc5c7b6caaa3245ecca7..f931ddf7059bcbe0c28fba650b2d2aa0e3dede12 100644 (file)
@@ -325,12 +325,12 @@ bool inBuildDir(FileName const & abs_binary,
 
        // Note that the name of the lyx binary may be a symbolic link.
        // If that is the case, then we follow the links too.
-    FileName binary = abs_binary;
+       FileName binary = abs_binary;
        while (true) {
                // Try and find "lyxrc.defaults".
-               if( isBuildDir(binary, "../", build_support_dir) ||
-            isBuildDir(binary, "../../", build_support_dir))
-        {
+               if ( isBuildDir(binary, "../", build_support_dir)
+                   || isBuildDir(binary, "../../", build_support_dir))
+               {
                        // Try and find "chkconfig.ltx".
                        system_support_dir =
                                FileName(addPath(Package::top_srcdir().absFileName(), "lib"));
@@ -359,7 +359,7 @@ bool inBuildDir(FileName const & abs_binary,
        system_support_dir = FileName();
        build_support_dir = FileName();
 
-    return false;
+       return false;
 }
 
 
@@ -508,9 +508,9 @@ FileName const get_binary_path(string const & exe)
                // This will do nothing if *it is already absolute.
                string const exe_dir = makeAbsPath(*it).absFileName();
 
-               FileName const exe_path(addName(exe_dir, exe_name));
-               if (exe_path.exists())
-                       return exe_path;
+               FileName const exe_path2(addName(exe_dir, exe_name));
+               if (exe_path2.exists())
+                       return exe_path2;
        }
 
        // Didn't find anything.