Fixies for search stuff in editor.
src/charsets.c: * fix error with recoding string for display edit/editcmd.c: * fix core dump if search dialog calls some multiple times * fix memory leak
Этот коммит содержится в:
родитель
95e2fb90ef
Коммит
6568cad9df
@ -2123,7 +2123,7 @@ edit_replace_cmd (WEdit *edit, int again)
|
|||||||
void edit_search_cmd (WEdit * edit, int again)
|
void edit_search_cmd (WEdit * edit, int again)
|
||||||
{
|
{
|
||||||
static char *old = NULL;
|
static char *old = NULL;
|
||||||
char *exp = "";
|
char *exp = "", *old_exp=NULL;
|
||||||
|
|
||||||
if (!edit) {
|
if (!edit) {
|
||||||
g_free (old);
|
g_free (old);
|
||||||
@ -2141,15 +2141,15 @@ void edit_search_cmd (WEdit * edit, int again)
|
|||||||
if (exp && *exp){
|
if (exp && *exp){
|
||||||
GString *tmp = str_convert_to_display (exp);
|
GString *tmp = str_convert_to_display (exp);
|
||||||
if (tmp && tmp->len){
|
if (tmp && tmp->len){
|
||||||
g_free(exp);
|
old_exp = exp = tmp->str;
|
||||||
exp = tmp->str;
|
|
||||||
}
|
}
|
||||||
if (tmp)
|
if (tmp)
|
||||||
g_string_free(tmp,FALSE);
|
g_string_free(tmp,FALSE);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_CHARSET */
|
#endif /* HAVE_CHARSET */
|
||||||
|
|
||||||
edit_search_dialog (edit, &exp);
|
edit_search_dialog (edit, &exp);
|
||||||
|
if (old_exp)
|
||||||
|
g_free(old_exp);
|
||||||
|
|
||||||
#ifdef HAVE_CHARSET
|
#ifdef HAVE_CHARSET
|
||||||
if (exp && *exp){
|
if (exp && *exp){
|
||||||
|
@ -256,7 +256,7 @@ str_convert_to_display (char *str)
|
|||||||
if (cp_display == cp_source)
|
if (cp_display == cp_source)
|
||||||
return g_string_new(str);
|
return g_string_new(str);
|
||||||
|
|
||||||
conv = str_crt_conv_from (cp_source);
|
conv = str_crt_conv_from (cp_display);
|
||||||
|
|
||||||
buff = g_string_new("");
|
buff = g_string_new("");
|
||||||
str_convert (conv, str, buff);
|
str_convert (conv, str, buff);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user