From 843221c52324b0a25431c1bd2472d93fa714d0fa Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Sat, 26 Jan 2002 17:24:01 +0000 Subject: [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 --- main.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 1d65b15..7d1b36d 100644 --- a/main.c +++ b/main.c @@ -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 @@ -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); } -- cgit v1.2.3