mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(set_panel_filter_to): rename variable and use MC_PTR_FREE macro.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
8bf7e69134
commit
a4518eed9e
@ -172,18 +172,15 @@ do_edit (const vfs_path_t * what_vpath)
|
|||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_panel_filter_to (WPanel * p, char *allocated_filter_string)
|
set_panel_filter_to (WPanel * p, char *filter)
|
||||||
{
|
{
|
||||||
g_free (p->filter);
|
MC_PTR_FREE (p->filter);
|
||||||
p->filter = NULL;
|
|
||||||
|
|
||||||
/* Three ways to clear filter: NULL, "", "*" */
|
/* Three ways to clear filter: NULL, "", "*" */
|
||||||
if (allocated_filter_string == NULL ||
|
if (filter == NULL || filter[0] == '\0' || (filter[0] == '*' && filter[1] == '\0'))
|
||||||
allocated_filter_string[0] == '\0' ||
|
g_free (filter);
|
||||||
(allocated_filter_string[0] == '*' && allocated_filter_string[1] == '\0'))
|
|
||||||
g_free (allocated_filter_string);
|
|
||||||
else
|
else
|
||||||
p->filter = allocated_filter_string;
|
p->filter = filter;
|
||||||
reread_cmd ();
|
reread_cmd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user