Skip to content

Commit

Permalink
fix warning about discarding const
Browse files Browse the repository at this point in the history
  • Loading branch information
knopwob committed Mar 20, 2013
1 parent 75366af commit 1a9c20a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions menu.c
Expand Up @@ -137,25 +137,27 @@ void invoke_action(const char *action)
*/
void dispatch_menu_result(const char *input)
{
g_strstrip(input);
switch (input[0]) {
char *in = strdup(input);
g_strstrip(in);
switch (in[0]) {
case '#':
invoke_action(input + 1);
invoke_action(in + 1);
break;
case '[': // named url. skip name and continue
input = strchr(input, ']');
if (input == NULL)
in = strchr(in, ']');
if (in == NULL)
break;
default:
{ // test and open url
char *maybe_url = extract_urls(input);
char *maybe_url = extract_urls(in);
if (maybe_url) {
open_browser(maybe_url);
free(maybe_url);
break;
}
}
}
free(in);
}

/*
Expand Down

0 comments on commit 1a9c20a

Please sign in to comment.