Skip to content

Commit

Permalink
fix crash after $histsize get commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed May 3, 2023
1 parent 0704da4 commit f824589
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gplaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,13 +1482,16 @@ static void cmd_get(char *line) {

page = TAILQ_FIRST(&history);
TAILQ_REMOVE(&history, page, next);
--depth;

sel.rawurl = page->url;
if (parse_url(&url, page->url, NULL, NULL)) new = navigate(&sel, &url);
free_url(&url);

if (SIMPLEQ_EMPTY(&new)) TAILQ_INSERT_HEAD(&history, page, next);
else free_page(page);
if (SIMPLEQ_EMPTY(&new)) {
TAILQ_INSERT_HEAD(&history, page, next);
++depth;
} else free_page(page);
}


Expand Down

0 comments on commit f824589

Please sign in to comment.