]> git.lyx.org Git - features.git/commitdiff
remove \r from line's end when present -- lyx2lyx
authorJosé Matox <jamatos@lyx.org>
Wed, 4 Aug 2004 15:12:14 +0000 (15:12 +0000)
committerJosé Matox <jamatos@lyx.org>
Wed, 4 Aug 2004 15:12:14 +0000 (15:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8867 a592a061-630c-0410-9148-cb99ea01b6c8

lib/lyx2lyx/ChangeLog
lib/lyx2lyx/parser_tools.py

index cd313dd09d49132f7fe5bbf13992129f20585997..8086a577898ce14b16657156c50636c946c113c5 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-05  José Matos  <jamatos@lyx.org>
+
+       * parser_tools.py (read_file): remove \r from line's end when present.
+
 2004-07-01  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * lyx_1_4.py (convert_paperpackage): new, convert paperpackage setting
@@ -15,7 +19,6 @@
 
 2004-05-11  José Matos  <jamatos@lyx.org>
 
-
        * parser_tools.py (get_backend): get the document backend.
        * lyx2lyx (main): new member of the document structure,
        the textclass and backend, that default to article and latex.
index 0d346205bfa4ea5bbdb828aac307829613f12c40..ff936821139c64594f67acb3f43e9d97476247fd 100644 (file)
@@ -210,6 +210,10 @@ def read_file(header, body, opt):
             opt.error("Invalid LyX file.")
 
         line = line[:-1]
+        # remove '\r' from line's end, if present
+        if line[-1:] == '\r':
+            line = line[:-1]
+
         if check_token(line, '\\begin_preamble'):
             preamble = 1
         if check_token(line, '\\end_preamble'):
@@ -227,7 +231,11 @@ def read_file(header, body, opt):
         line = opt.input.readline()
         if not line:
             break
-        body.append(line[:-1])
+        # remove '\r' from line's end, if present
+        if line[-2:-1] == '\r':
+            body.append(line[:-2])
+        else:
+            body.append(line[:-1])
 
 
 def write_file(header, body, opt):