Skip to content

Commit 737de08

Browse files
committed
(check_file_access): return FALSE immediately in case of error message
...to get rid of double rising of error message. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
1 parent 7bf13fe commit 737de08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/editor/edit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ check_file_access (WEdit *edit, const vfs_path_t *filename_vpath, struct stat *s
308308
if (file < 0)
309309
{
310310
file_error_message (_ ("Cannot open\n%s"), vfs_path_as_str (filename_vpath));
311-
goto cleanup;
311+
return FALSE;
312312
}
313313

314314
// New file, delete it if it's not modified or saved
@@ -319,7 +319,7 @@ check_file_access (WEdit *edit, const vfs_path_t *filename_vpath, struct stat *s
319319
if (mc_fstat (file, st) < 0)
320320
{
321321
file_error_message (_ ("Cannot stat\n%s"), vfs_path_as_str (filename_vpath));
322-
goto cleanup;
322+
return FALSE;
323323
}
324324

325325
// We want to open regular files only

0 commit comments

Comments
 (0)