diff options
Diffstat (limited to 'src/commands.cc')
| -rw-r--r-- | src/commands.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/commands.cc b/src/commands.cc index 30113af2..accb3e37 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -480,7 +480,7 @@ void do_write_buffer(Context& context, Optional<String> filename, WriteFlags fla const bool is_readonly = (bool)(context.buffer().flags() & Buffer::Flags::ReadOnly); // if the buffer is in read-only mode and we try to save it directly // or we try to write to it indirectly using e.g. a symlink, throw an error - if (is_file and is_readonly and + if (is_file and is_readonly and (not filename or real_path(*filename) == buffer.name())) throw runtime_error("cannot overwrite the buffer when in readonly mode"); |
