Another short fix that goes in tomorrow if nobody objects. See 
http://bugzilla.lyx.org/show_bug.cgi?id=2404 for details.


Georg
Log:
Fix bug 2404
        * src/buffer_funcs.C
        (newFile): Use fresh buffer if readFile did not succeed
Index: src/buffer_funcs.C
===================================================================
--- src/buffer_funcs.C	(Revision 14468)
+++ src/buffer_funcs.C	(Arbeitskopie)
@@ -195,6 +195,10 @@ Buffer * newFile(string const & filename
 			string const text  = bformat(_("The specified document template\n%1$s\ncould not be read."), file);
 			Alert::error(_("Could not read template"), text);
 			// no template, start with empty buffer
+			// Use a fresh one since readFile may have corrupted
+			// the old one (bug 2404)
+			bufferlist.release(b);
+			b = bufferlist.newBuffer(filename);
 		}
 	}
 

Reply via email to