]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.cpp
Fix bug 9798.
[lyx.git] / src / support / filetools.cpp
index bcfd1b6c9ea741c41910c475a5213849eb505496..37fd14f54d425b2d28c61826132adc5d7385ac86 100644 (file)
@@ -1141,7 +1141,8 @@ cmd_ret const runCommand(string const & cmd)
 }
 
 
-FileName const findtexfile(string const & fil, string const & /*format*/)
+FileName const findtexfile(string const & fil, string const & /*format*/,
+                                                  bool const onlykpse)
 {
        /* There is no problem to extend this function too use other
           methods to look for files. It could be setup to look
@@ -1154,9 +1155,11 @@ FileName const findtexfile(string const & fil, string const & /*format*/)
 
        // If the file can be found directly, we just return a
        // absolute path version of it.
-       FileName const absfile(makeAbsPath(fil));
-       if (absfile.exists())
-               return absfile;
+       if (!onlykpse) {
+               FileName const absfile(makeAbsPath(fil));
+               if (absfile.exists())
+                       return absfile;
+       }
 
        // Now we try to find it using kpsewhich.
        // It seems from the kpsewhich manual page that it is safe to use