Skip to content

Commit

Permalink
fix segfault when navigating to a URL with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Apr 24, 2023
1 parent 172b87d commit 0138400
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gplaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,9 +1403,8 @@ static void eval(const char *input, const char *filename, int line_no) {
long index;

if ((index = strtol(input, &end, 10)) > 0 && index < INT_MAX && *end == '\0' && (to = find_selector(&menu, (int)index)) != NULL) {
if ((to->url || parse_url(to, current, NULL)) && interactive) bestlineHistoryAdd(to->url);
if ((to->url || parse_url(to, current, NULL)) && interactive) { bestlineHistoryAdd(to->url); navigate(to); }
else if (interactive) bestlineHistoryAdd(input);
navigate(to);
return;
} else if (index > 0 && index != LONG_MAX && *end == '\0') return;

Expand Down

0 comments on commit 0138400

Please sign in to comment.