* edit.c (user_menu): If the error file is missing, treat it as
success. Truncate block file unconditionally.
Этот коммит содержится в:
родитель
b1c57095b2
Коммит
edf0504087
@ -1,3 +1,8 @@
|
|||||||
|
2001-10-23 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* edit.c (user_menu): If the error file is missing, treat it as
|
||||||
|
success. Truncate block file unconditionally.
|
||||||
|
|
||||||
2001-10-22 Pavel Roskin <proski@gnu.org>
|
2001-10-22 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* edit.c: Stop using _EDIT_C definition. Move variable
|
* edit.c: Stop using _EDIT_C definition. Move variable
|
||||||
|
53
edit/edit.c
53
edit/edit.c
@ -2700,31 +2700,38 @@ void user_menu (WEdit *edit)
|
|||||||
/* run shell scripts from menu */
|
/* run shell scripts from menu */
|
||||||
user_menu_cmd (edit);
|
user_menu_cmd (edit);
|
||||||
|
|
||||||
if (mc_stat (error_file, &status) == 0) {
|
if (mc_stat (error_file, &status) != 0 || !status.st_size) {
|
||||||
if (!status.st_size) { /* no error messages */
|
/* no error messages */
|
||||||
if (mc_stat (block_file, &status) == 0)
|
if (mc_stat (block_file, &status) != 0 || !status.st_size) {
|
||||||
if (!status.st_size)
|
/* no block messages */
|
||||||
return; /* no block messages */
|
return;
|
||||||
if (! nomark) /* i.e. we have marked block */
|
}
|
||||||
rc = edit_block_delete_cmd(edit);
|
|
||||||
if (!rc) {
|
if (! nomark) {
|
||||||
edit_cursor_to_bol (edit);
|
/* i.e. we have marked block */
|
||||||
edit_insert_file (edit, block_file);
|
rc = edit_block_delete_cmd(edit);
|
||||||
edit_cursor_to_eol (edit);
|
}
|
||||||
if ((fd = fopen (block_file, "w"))) fclose(fd);
|
|
||||||
}
|
if (!rc) {
|
||||||
} else { /* it is error */
|
edit_cursor_to_bol (edit);
|
||||||
edit_cursor_to_bol (edit);
|
edit_insert_file (edit, block_file);
|
||||||
edit_insert_file (edit, error_file);
|
edit_cursor_to_eol (edit);
|
||||||
if ((fd = fopen (error_file, "w"))) fclose(fd);
|
}
|
||||||
if ((fd = fopen (block_file, "w"))) fclose(fd);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
edit_error_dialog ("",
|
/* error file exists and is not empty */
|
||||||
get_sys_error (catstrs (_ ("Error trying to stat file:"),
|
edit_cursor_to_bol (edit);
|
||||||
error_file, 0)));
|
edit_insert_file (edit, error_file);
|
||||||
return;
|
|
||||||
|
/* truncate error file */
|
||||||
|
if ((fd = fopen (error_file, "w")))
|
||||||
|
fclose(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* truncate block file */
|
||||||
|
if ((fd = fopen (block_file, "w"))) {
|
||||||
|
fclose(fd);
|
||||||
|
}
|
||||||
|
|
||||||
edit_refresh_cmd (edit);
|
edit_refresh_cmd (edit);
|
||||||
edit->force |= REDRAW_COMPLETELY;
|
edit->force |= REDRAW_COMPLETELY;
|
||||||
return;
|
return;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user