diff options
Diffstat (limited to 'src/uicmd.cc')
-rw-r--r-- | src/uicmd.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/uicmd.cc b/src/uicmd.cc index a4e1f372..dd5478cc 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -1004,15 +1004,24 @@ void a_UIcmd_view_page_source(BrowserWindow *bw, const DilloUrl *url) int buf_size; Dstr *dstr_url; DilloUrl *vs_url; + static int post_id = 0; + char tag[8]; if (a_Nav_get_buf(url, &buf, &buf_size)) { + a_Nav_set_vsource_url(url); dstr_url = dStr_new("dpi:/vsource/:"); dStr_append(dstr_url, URL_STR(url)); - + if (URL_FLAGS(url) & URL_Post) { + /* append a custom string to differentiate POST URLs */ + post_id = (post_id < 9999) ? post_id + 1 : 0; + snprintf(tag, 8, "_%.4d", post_id); + dStr_append(dstr_url, tag); + } vs_url = a_Url_new(dstr_url->str, NULL); a_UIcmd_open_url_nt(bw, vs_url, 1); a_Url_free(vs_url); dStr_free(dstr_url, 1); + a_Nav_unref_buf(url); } } |