mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-11 18:32:53 +03:00
Merge branch '3813_filter_clear'
* 3813_filter_clear: Ticket #3813: Filter isn't cleared when entering empty string.
This commit is contained in:
commit
e4983a18e8
@ -174,12 +174,15 @@ static void
|
||||
set_panel_filter_to (WPanel * p, char *allocated_filter_string)
|
||||
{
|
||||
g_free (p->filter);
|
||||
p->filter = 0;
|
||||
p->filter = NULL;
|
||||
|
||||
if (!(allocated_filter_string[0] == '*' && allocated_filter_string[1] == 0))
|
||||
p->filter = allocated_filter_string;
|
||||
else
|
||||
/* 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);
|
||||
else
|
||||
p->filter = allocated_filter_string;
|
||||
reread_cmd ();
|
||||
}
|
||||
|
||||
|
@ -1584,8 +1584,7 @@ panel_print_header (const WPanel * panel)
|
||||
|
||||
g_string_append (format_txt, format->title);
|
||||
|
||||
if (panel->filter != NULL && *panel->filter != '\0'
|
||||
&& strcmp (format->id, "name") == 0)
|
||||
if (panel->filter != NULL && strcmp (format->id, "name") == 0)
|
||||
{
|
||||
g_string_append (format_txt, " [");
|
||||
g_string_append (format_txt, panel->filter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user