mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-06 16:11:32 +03:00
(str_nconvert_to_input): return NULL if input is NULL.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
464a2eeefc
commit
0869946de5
@ -390,7 +390,7 @@ str_nconvert_to_input (const char *str, int len)
|
||||
GIConv conv;
|
||||
|
||||
if (str == NULL)
|
||||
return g_string_new ("");
|
||||
return NULL;
|
||||
|
||||
if (cp_display == cp_source)
|
||||
return g_string_new (str);
|
||||
|
@ -127,7 +127,10 @@ mcdiffview_dialog_search (WDiff * dview)
|
||||
|
||||
tmp = str_convert_to_input (exp);
|
||||
g_free (exp);
|
||||
exp = g_string_free (tmp, FALSE);
|
||||
if (tmp != NULL)
|
||||
exp = g_string_free (tmp, FALSE);
|
||||
else
|
||||
exp = g_strdup ("");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -327,10 +327,12 @@ edit_complete_word_insert_recoded_completion (WEdit * edit, char *completion, gs
|
||||
GString *temp;
|
||||
|
||||
temp = str_convert_to_input (completion);
|
||||
|
||||
for (completion = temp->str + word_len; *completion != '\0'; completion++)
|
||||
edit_insert (edit, *completion);
|
||||
g_string_free (temp, TRUE);
|
||||
if (temp != NULL)
|
||||
{
|
||||
for (completion = temp->str + word_len; *completion != '\0'; completion++)
|
||||
edit_insert (edit, *completion);
|
||||
g_string_free (temp, TRUE);
|
||||
}
|
||||
#else
|
||||
for (completion += word_len; *completion != '\0'; completion++)
|
||||
edit_insert (edit, *completion);
|
||||
|
@ -136,7 +136,10 @@ edit_dialog_search_show (WEdit * edit)
|
||||
|
||||
tmp = str_convert_to_input (search_text);
|
||||
g_free (search_text);
|
||||
search_text = g_string_free (tmp, FALSE);
|
||||
if (tmp != NULL)
|
||||
search_text = g_string_free (tmp, FALSE);
|
||||
else
|
||||
search_text = g_strdup ("");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -556,9 +559,12 @@ edit_replace_cmd__conv_to_input (char *str)
|
||||
GString *tmp;
|
||||
|
||||
tmp = str_convert_to_input (str);
|
||||
if (tmp->len != 0)
|
||||
return g_string_free (tmp, FALSE);
|
||||
g_string_free (tmp, TRUE);
|
||||
if (tmp != NULL)
|
||||
{
|
||||
if (tmp->len != 0)
|
||||
return g_string_free (tmp, FALSE);
|
||||
g_string_free (tmp, TRUE);
|
||||
}
|
||||
#endif
|
||||
return g_strdup (str);
|
||||
}
|
||||
|
@ -122,7 +122,10 @@ mcview_dialog_search (WView * view)
|
||||
|
||||
tmp = str_convert_to_input (exp);
|
||||
g_free (exp);
|
||||
exp = g_string_free (tmp, FALSE);
|
||||
if (tmp != NULL)
|
||||
exp = g_string_free (tmp, FALSE);
|
||||
else
|
||||
exp = g_strdup ("");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user