Skip to content

Commit

Permalink
add the URL to history, on status code 10
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed May 23, 2022
1 parent d12a71b commit d18d007
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ additional documentation and more details are available in `man gplaces`. type `
## Statistic
Language|files|blank|comment|code
:-------|-------:|-------:|-------:|-------:
C|1|232|58|1048
C|1|232|58|1049
1 change: 1 addition & 0 deletions com.github.dimkr.gplaces.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<description>
<ul>
<li>Extended support for plain text files</li>
<li>URLs with user input are now saved to history</li>
<li>More useful default settings</li>
</ul>
</description>
Expand Down
3 changes: 2 additions & 1 deletion gplaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ static int do_download(Selector *sel, SSL_CTX *ctx, const char *crtpath, const c
if (data[1] == '1') bestlineMaskModeDisable();
if (curl_url_set(sel->cu, CURLUPART_QUERY, line, CURLU_NON_SUPPORT_SCHEME) != CURLUE_OK || curl_url_get(sel->cu, CURLUPART_URL, &url, 0) != CURLUE_OK) { free(line); goto fail; }
curl_free(sel->url); sel->url = url;
if (data[1] != '1' && interactive) bestlineHistoryAdd(url);
free(line);
break;

Expand Down Expand Up @@ -1234,8 +1235,8 @@ static void shell(int argc, char **argv) {
else if (interactive) bestlineHistoryAdd(line);
navigate(to);
} else if (index <= 0) {
eval(line, NULL, 0);
if (interactive) bestlineHistoryAdd(line);
eval(line, NULL, 0);
}
free(base);
}
Expand Down

0 comments on commit d18d007

Please sign in to comment.