The following patch is adapted from one of the last bits in the patch
that Claus Hentschel uses on win32. It fixes parsing of log files by
removing trailing \r. 

OK to apply?

JMarc

? config.h.in
? src/ext_l10n.h
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.999
diff -u -p -r1.999 ChangeLog
--- src/ChangeLog	18 Dec 2002 14:36:28 -0000	1.999
+++ src/ChangeLog	20 Dec 2002 13:43:22 -0000
@@ -1,3 +1,8 @@
+2002-12-20  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* LaTeX.C (scanLogFile): remove trailing '\r' in lines read
+	through getline() (adapted from Claus Henschel's win32 port).
+
 2002-12-17  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* text2.C (pasteEnvironmentType): avoid crash if layout-copy has
Index: src/LaTeX.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeX.C,v
retrieving revision 1.73
diff -u -p -r1.73 LaTeX.C
--- src/LaTeX.C	27 Nov 2002 10:30:03 -0000	1.73
+++ src/LaTeX.C	20 Dec 2002 13:43:22 -0000
@@ -550,6 +550,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
 
 	string token;
 	while (getline(ifs, token)) {
+		token = rtrim(token, "\r"); // Claus Hentschel for Win32
 		lyxerr[Debug::LATEX] << "Log line: " << token << endl;
 
 		if (token.empty())
@@ -614,6 +615,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
 				if (++count > 10)
 					break;
 			} while (!prefixIs(tmp, "l."));
+			tmp = rtrim(tmp, "\r"); // ... Win32
 			if (prefixIs(tmp, "l.")) {
 				// we have a latex error
 				retval |=  TEX_ERROR;
@@ -626,6 +628,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
 				string errstr(tmp, tmp.find(' '));
 				errstr += '\n';
 				getline(ifs, tmp);
+				tmp = rtrim(tmp, "\r"); // ... Win32
 				while (!contains(errstr, "l.")
 				       && !tmp.empty()
 				       && !prefixIs(tmp, "! ")
@@ -633,6 +636,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
 					errstr += tmp;
 					errstr += "\n";
 					getline(ifs, tmp);
+					tmp = rtrim(tmp, "\r"); // ... Win32
 				}
 				lyxerr[Debug::LATEX]
 					<< "line: " << line << '\n'

Reply via email to