mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-03 14:41:34 +03:00
* edit/editcmd.c (edit_save_as_cmd): If saving of the file fails
remove only the _save_ lock.
This commit is contained in:
parent
239d8a64c2
commit
1ab4a2b41c
@ -1,3 +1,8 @@
|
|||||||
|
2006-03-17 Oswald Buddenhagen <ossi@kde.org>
|
||||||
|
|
||||||
|
* editcmd.c (edit_save_as_cmd): If saving of the file fails
|
||||||
|
remove only the _save_ lock.
|
||||||
|
|
||||||
2006-03-15 Pavel Tsekov <ptsekov@gmx.net>
|
2006-03-15 Pavel Tsekov <ptsekov@gmx.net>
|
||||||
|
|
||||||
* editlock.c: Fix for savannah bug #13673.
|
* editlock.c: Fix for savannah bug #13673.
|
||||||
|
@ -489,6 +489,7 @@ edit_save_as_cmd (WEdit *edit)
|
|||||||
edit->force |= REDRAW_COMPLETELY;
|
edit->force |= REDRAW_COMPLETELY;
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
int rv;
|
||||||
if (strcmp (edit->filename, exp)) {
|
if (strcmp (edit->filename, exp)) {
|
||||||
int file;
|
int file;
|
||||||
different_filename = 1;
|
different_filename = 1;
|
||||||
@ -512,9 +513,11 @@ edit_save_as_cmd (WEdit *edit)
|
|||||||
save_lock = edit_lock_file (exp);
|
save_lock = edit_lock_file (exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edit_save_file (edit, exp)) {
|
rv = edit_save_file (edit, exp);
|
||||||
|
switch (rv) {
|
||||||
|
case 1:
|
||||||
/* Succesful, so unlock both files */
|
/* Succesful, so unlock both files */
|
||||||
if (strcmp (edit->filename, exp)) {
|
if (different_filename) {
|
||||||
if (save_lock)
|
if (save_lock)
|
||||||
edit_unlock_file (exp);
|
edit_unlock_file (exp);
|
||||||
if (edit->locked)
|
if (edit->locked)
|
||||||
@ -532,12 +535,10 @@ edit_save_as_cmd (WEdit *edit)
|
|||||||
edit_load_syntax (edit, NULL, option_syntax_type);
|
edit_load_syntax (edit, NULL, option_syntax_type);
|
||||||
edit->force |= REDRAW_COMPLETELY;
|
edit->force |= REDRAW_COMPLETELY;
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
default:
|
||||||
/* Failed, so maintain modify (not save) lock */
|
/* Failed, so maintain modify (not save) lock */
|
||||||
if (strcmp (edit->filename, exp) && save_lock)
|
|
||||||
edit_unlock_file (exp);
|
|
||||||
if (save_lock)
|
if (save_lock)
|
||||||
edit->locked = edit_unlock_file (edit->filename);
|
edit_unlock_file (exp);
|
||||||
g_free (exp);
|
g_free (exp);
|
||||||
edit_error_dialog (_(" Save As "),
|
edit_error_dialog (_(" Save As "),
|
||||||
get_sys_error (_
|
get_sys_error (_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user