From e4b8f03af50930c421d7504103089ff034756f7e Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 21 Jun 2001 10:55:48 +0000 Subject: [PATCH] fix read problems on win32 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2139 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/LaTeX.C | 2 ++ src/support/ChangeLog | 5 +++++ src/support/filetools.C | 5 ++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 55f9e25353..47b70bd4ef 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-06-20 Jean-Marc Lasgouttes + + * LaTeX.C (scanAuxFile): + (deplog): remove trailing \r when reading stream (useful under + win32) + 2001-06-15 Angus Leeming * BufferView_pimpl.C (fitCursor): emit a signal updateParagraph. diff --git a/src/LaTeX.C b/src/LaTeX.C index a8106ccf2f..d2e152cc06 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -407,6 +407,7 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info) LRegex reg4("\\\\@input\\{([^}]+)\\}"); while (getline(ifs, token)) { + token = strip(token, '\r'); if (reg1.exact_match(token)) { LRegex::SubMatches const & sub = reg1.exec(token); string data = LSubstring(token, sub[1].first, @@ -645,6 +646,7 @@ void LaTeX::deplog(DepTable & head) string foundfile; string token; getline(ifs, token); + token = strip(token, '\r'); if (token.empty()) continue; if (reg1.exact_match(token)) { diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 6e804ed00d..38661281ac 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2001-06-20 Jean-Marc Lasgouttes + + * filetools.C (findtexfile): strip final \r if necessary (for + cygwin) + 2001-06-19 Angus Leeming * FileInfo.C: diff --git a/src/support/filetools.C b/src/support/filetools.C index 10335730aa..9ced099097 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -1072,7 +1072,10 @@ findtexfile(string const & fil, string const & /*format*/) lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n" << "kpse result = `" << strip(c.second, '\n') << "'" << endl; - return c.first != -1 ? strip(c.second, '\n') : string(); + if (c.first != -1) + return strip(strip(c.second, '\n'), '\r'); + else + return string(); } -- 2.39.2