Skip to content
Snippets Groups Projects
Commit 1a62b003 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'master' into 'master'

Fix Issue #83 - Panic on write without filename

See merge request redox-os/sodium!87
parents 88f55176 ddc8c882
No related branches found
No related tags found
No related merge requests found
......@@ -37,10 +37,10 @@ impl Editor {
}
/// Write the file.
pub fn write<'a> (&'a mut self, mut path: &'a str) -> FileStatus {
pub fn write<'a> (&'a mut self, path: &'a str) -> FileStatus {
self.buffers.current_buffer_info_mut().title = Some(path.into());
if path == "" {
path = self.files[0].as_str();
return FileStatus::Other;
}
if let Some(mut file) = File::create(path).ok() {
if file.write(self.buffers.current_buffer().to_string().as_bytes())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment