From: Georg Baum Date: Fri, 16 Mar 2007 12:14:06 +0000 (+0000) Subject: * src/LaTeX.C X-Git-Tag: 1.6.10~10587 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8a856a23796f8e90d1b4160b3ae13dfbb13f84c4;p=features.git * src/LaTeX.C (handleFoundFile): Don't strip off " permanently (handleFoundFile): Fix another case of embedded 0 (LaTeX::deplog): Small simplification git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17454 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LaTeX.C b/src/LaTeX.C index 9eb2176196..c2cff5f4ed 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -802,7 +802,7 @@ bool handleFoundFile(string const & ff, DepTable & head) while (contains(strippedfile, " ")) { // files with spaces are often enclosed in quotation // marks; those have to be removed - string unquoted = subst(strippedfile, '"', char()); + string unquoted = subst(strippedfile, "\"", ""); absname.set(unquoted); if (insertIfExists(absname, head)) return true; @@ -833,12 +833,20 @@ bool handleFoundFile(string const & ff, DepTable & head) if (exists) // everything o.k. break; - else if (contains(foundfile, '"')) { + else { // files with spaces are often enclosed in quotation - // marks; remove those and try again + // marks; those have to be removed string unquoted = subst(foundfile, "\"", ""); absname = makeAbsPath(unquoted); - } else { + exists = fs::native(absname.toFilesystemEncoding()); + if (exists) + exists = fs::exists(absname.toFilesystemEncoding()); + else + lyxerr[Debug::DEPEND] << '`' + << absname.absFilename() + << "' is no valid file name." << endl; + if (exists) + break; // strip off part after last space and try again string strippedfile; string const stripoff = @@ -982,9 +990,7 @@ void LaTeX::deplog(DepTable & head) token = lastline + token; if (token.length() > 255) { // string too long. Cut off. - int r = token.length() - 250; - string ntoken = token.substr(r, token.length()); - token = ntoken; + token.erase(0, token.length() - 251); } smatch sub;