From a4518eed9e1d560cfc3a6a2de53d88eaf8263762 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 3 May 2017 14:55:57 +0300 Subject: [PATCH] (set_panel_filter_to): rename variable and use MC_PTR_FREE macro. Signed-off-by: Andrew Borodin --- src/filemanager/cmd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index 46e174820..a810f2c54 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -172,18 +172,15 @@ do_edit (const vfs_path_t * what_vpath) /* --------------------------------------------------------------------------------------------- */ static void -set_panel_filter_to (WPanel * p, char *allocated_filter_string) +set_panel_filter_to (WPanel * p, char *filter) { - g_free (p->filter); - p->filter = NULL; + MC_PTR_FREE (p->filter); /* Three ways to clear filter: NULL, "", "*" */ - if (allocated_filter_string == NULL || - allocated_filter_string[0] == '\0' || - (allocated_filter_string[0] == '*' && allocated_filter_string[1] == '\0')) - g_free (allocated_filter_string); + if (filter == NULL || filter[0] == '\0' || (filter[0] == '*' && filter[1] == '\0')) + g_free (filter); else - p->filter = allocated_filter_string; + p->filter = filter; reread_cmd (); }