fix saving of text files

This commit is contained in:
Vadim Lopatin 2015-01-22 18:16:45 +03:00
parent 173388fdff
commit fdb965b45c
2 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ class OutputLineStream {
} }
protected void flush() { protected void flush() {
if (_len > 0) { if (_len > 0) {
_stream.write(_buf[0.._len]); _stream.writeExact(_buf.ptr, _len);
_len = 0; _len = 0;
} }
} }

View File

@ -1063,7 +1063,7 @@ class EditableContent {
if (!filename) if (!filename)
filename = _filename; filename = _filename;
try { try {
std.stream.File f = new std.stream.File(filename, FileMode.Out); std.stream.File f = new std.stream.File(filename, FileMode.OutNew);
scope(exit) { f.close(); } scope(exit) { f.close(); }
return save(f, filename, format); return save(f, filename, format);
} catch (Exception e) { } catch (Exception e) {