mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Merge branch '2761_editor_save_as_dir'
* 2761_editor_save_as_dir: Ticket #2761: save file on top of existing directory changes dir's permissions
This commit is contained in:
commit
835f72fcaf
@ -1488,6 +1488,15 @@ edit_save_as_cmd (WEdit * edit)
|
||||
if (vfs_path_cmp (edit->filename_vpath, exp_vpath) != 0)
|
||||
{
|
||||
int file;
|
||||
struct stat sb;
|
||||
|
||||
if (mc_stat (exp_vpath, &sb) == 0 && !S_ISREG (sb.st_mode))
|
||||
{
|
||||
edit_error_dialog (_("Save as"),
|
||||
get_sys_error (_
|
||||
("Cannot save: destination is not a regular file")));
|
||||
goto ret;
|
||||
}
|
||||
|
||||
different_filename = 1;
|
||||
file = mc_open (exp_vpath, O_RDONLY | O_BINARY);
|
||||
|
Loading…
Reference in New Issue
Block a user