GNOME Bugzilla – Bug 626739
gedit adds random lines when saving in Windows mode
Last modified: 2010-10-30 11:36:36 UTC
this report has been filed here: https://bugs.edge.launchpad.net/ubuntu/+source/gedit/+bug/616441 "The four attached files were generated like this. Open rom_bourg16_rew.txt with gedit, "save as" rom_bourg16_rew2.txt with Windows-style line returns. Close the file. open rom_bourg16_rew2.txt , save it as rom_bourg16_rew3.txt Close, open rom_bourg16_rew3.txt, save it as rom_bourg16_rew4.txt Every time it saves, gedit adds new lines at random places. The three last files should be the same." files: https://bugs.edge.launchpad.net/ubuntu/+source/gedit/+bug/616441/+attachment/1485013/+files/bug_gedit.zip
Created attachment 169215 [details] Minimal test case Opening the file creates one additional newline if the Carriage Return/Line Feed combination (CR LF) is both ways from a 8192-byte page. The file is saved with this additional newline. See the attached file (its MIME type is application/octet-stream, just in case!), which serves as a test case for this bug. In a hex editor, it's 8191 'a', then CR LF, then 1 'a'. In gedit, this makes 2 newlines. Using gedit 2.30.3.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.