Lars Gullik Bjønnes wrote:
> I am talking about this bit:

I see. That was a misunderstanding then.

Something like the attached?

Jürgen
Index: src/LaTeX.C
===================================================================
--- src/LaTeX.C	(Revision 17270)
+++ src/LaTeX.C	(Arbeitskopie)
@@ -723,6 +723,17 @@
 
 namespace {
 
+bool insertIfExists(FileName const & absname, DepTable & head)
+{
+	fs::path const path = absname.toFilesystemEncoding();
+	if (fs::exists(path) && !fs::is_directory(path)) {
+			head.insert(absname, true);
+			return true;
+	}
+	return false;
+}
+
+
 bool handleFoundFile(string const & ff, DepTable & head)
 {
 	// convert from native os path to unix path
@@ -746,11 +757,7 @@
 		// since this file cannot be a file generated by
 		// the latex run.
 		FileName absname(foundfile);
-		if (fs::exists(absname.toFilesystemEncoding()) &&
-		    !fs::is_directory(absname.toFilesystemEncoding())) {
-				head.insert(absname, true);
-				return true;
-		} else {
+		if (!insertIfExists(absname, head)) {
 			// check for spaces
 			string strippedfile = foundfile;
 			while (contains(strippedfile, " ")) {
@@ -759,11 +766,8 @@
 				string const stripoff =
 					rsplit(tmp, strippedfile, ' ');
 				absname.set(strippedfile);
-				if (fs::exists(absname.toFilesystemEncoding()) &&
-				    !fs::is_directory(absname.toFilesystemEncoding())) {
-					head.insert(absname, true);
+				if (insertIfExists(absname, head))
 					return true;
-				}
 			}
 		}
 	}
@@ -788,8 +792,8 @@
 
 	// (2) foundfile is in the tmpdir
 	//     insert it into head
-	if (fs::exists(absname.toFilesystemEncoding()) &&
-	    !fs::is_directory(absname.toFilesystemEncoding())) {
+	fs::path const path = absname.toFilesystemEncoding();
+	if (fs::exists(path) && !fs::is_directory(path)) {
 		static regex unwanted("^.*\\.(aux|log|dvi|bbl|ind|glo)$");
 		if (regex_match(onlyfile, unwanted)) {
 			lyxerr[Debug::DEPEND]

Reply via email to