Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hidden modes: Do not hide modes when no hidden modes are defined
When no hidden modes where defined all modes would be hidden,
when the key was not in the config file. Thanks to Matti Kosola
for reporting.

Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
  • Loading branch information
philippedeswert committed Mar 9, 2016
1 parent 2492f2e commit 32a2a2a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/usb_moded.c
Expand Up @@ -445,9 +445,6 @@ gchar *get_mode_list(void)

modelist_str = g_string_new(NULL);

if(!hidden_mode_split)
goto nomodelist;

if(!diag_mode)
{
/* check dynamic modes */
Expand All @@ -458,7 +455,7 @@ gchar *get_mode_list(void)
for( iter = modelist; iter; iter = g_list_next(iter) )
{
struct mode_list_elem *data = iter->data;
if(hidden_modes_list)
if(hidden_modes_list && hidden_mode_split)
for(i = 0; hidden_mode_split[i] != NULL; i++)
{
if(!strcmp(hidden_mode_split[i], data->mode_name))
Expand All @@ -475,9 +472,9 @@ gchar *get_mode_list(void)
}
}

if(hidden_mode_split)
g_strfreev(hidden_mode_split);

nomodelist:
/* end with charging mode */
g_string_append(modelist_str, MODE_CHARGING);
return(g_string_free(modelist_str, FALSE));
Expand Down

0 comments on commit 32a2a2a

Please sign in to comment.