diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-26 17:24:01 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-26 17:24:01 +0000 |
commit | 843221c52324b0a25431c1bd2472d93fa714d0fa (patch) | |
tree | 36df5e8f54c46c50751195562ccc1e787e272786 /main.c | |
parent | [w3m-dev 02913] wrong table width calculation (diff) | |
download | w3m-843221c52324b0a25431c1bd2472d93fa714d0fa.tar.gz w3m-843221c52324b0a25431c1bd2472d93fa714d0fa.zip |
[w3m-dev 02914]
* history.c (copyHist): added
* history.h (copyHist): ditto
* main.c (goURL0): copyHist(URLHist), push current and anchor URLs
default set by DefaultURLString
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 33 |
1 files changed, 21 insertions, 12 deletions
@@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.72 2002/01/24 17:46:50 ukai Exp $ */ +/* $Id: main.c,v 1.73 2002/01/26 17:24:01 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -3621,19 +3621,28 @@ goURL0(char *prompt, int relative) url = searchKeyData(); if (url == NULL) { - if (DefaultURLString == DEFAULT_URL_CURRENT) { - current = baseURL(Currentbuf); - if (current) - url = parsedURL2Str(current)->ptr; + Hist *hist = copyHist(URLHist); + Anchor *a; + + current = baseURL(Currentbuf); + if (current) { + char *c_url = parsedURL2Str(current)->ptr; + if (DefaultURLString == DEFAULT_URL_CURRENT) + url = c_url; + else + pushHist(hist, c_url); } - else if (DefaultURLString == DEFAULT_URL_LINK) { - Anchor *a = retrieveCurrentAnchor(Currentbuf); - if (a) { - parseURL2(a->url, &p_url, baseURL(Currentbuf)); - url = parsedURL2Str(&p_url)->ptr; - } + a = retrieveCurrentAnchor(Currentbuf); + if (a) { + char *a_url; + parseURL2(a->url, &p_url, current); + a_url = parsedURL2Str(&p_url)->ptr; + if (DefaultURLString == DEFAULT_URL_LINK) + url = a_url; + else + pushHist(hist, a_url); } - url = inputLineHist(prompt, url, IN_URL, URLHist); + url = inputLineHist(prompt, url, IN_URL, hist); if (url != NULL) SKIP_BLANKS(url); } |