Merge branch '2183_edit_crash'
* 2183_edit_crash: Ticket #2183: edit crash while opening some incorrect files.
Этот коммит содержится в:
Коммит
15fe01a47e
@ -904,13 +904,6 @@ edit_init (WEdit * edit, int lines, int columns, const char *filename, long line
|
||||
edit->stack_size = START_STACK_SIZE;
|
||||
edit->stack_size_mask = START_STACK_SIZE - 1;
|
||||
edit->undo_stack = g_malloc0 ((edit->stack_size + 10) * sizeof (long));
|
||||
if (edit_load_file (edit))
|
||||
{
|
||||
/* edit_load_file already gives an error message */
|
||||
if (to_free)
|
||||
g_free (edit);
|
||||
return 0;
|
||||
}
|
||||
edit->utf8 = 0;
|
||||
edit->converter = str_cnv_from_term;
|
||||
#ifdef HAVE_CHARSET
|
||||
@ -934,6 +927,14 @@ edit_init (WEdit * edit, int lines, int columns, const char *filename, long line
|
||||
}
|
||||
#endif
|
||||
|
||||
if (edit_load_file (edit))
|
||||
{
|
||||
/* edit_load_file already gives an error message */
|
||||
if (to_free)
|
||||
g_free (edit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
edit->loading_done = 1;
|
||||
edit->modified = 0;
|
||||
edit->locked = 0;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user