aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-23 17:19:47 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-23 17:19:47 +0000
commit316998e06ad1b3fba1831ff77a46305ed5d10dc5 (patch)
treeaf093e7c7143d57124d02195263609dafe824b04 /main.c
parent[w3m-dev 02889] fix scripts/multipart/multipart.cgi.in (diff)
downloadw3m-316998e06ad1b3fba1831ff77a46305ed5d10dc5.tar.gz
w3m-316998e06ad1b3fba1831ff77a46305ed5d10dc5.zip
[w3m-dev 02894] Re: goURL
* file.c (HTMLtagproc1): s/goURL/gorURL/ * keybind.c (EscKeymap): M-u = GOTO_RELATIVE * keybind_lynx.c (EscKeymap): ditto * doc/keymap.default: ditto * doc/keymap.lynx: ditto * doc-jp/keymap.default: ditto * doc-jp/keymap.lynx: ditto * main.c (MAIN): add $HTTP_HOME or $WWW_HOME to history * main.c (MAIN): add history even if it is local file or local cgi * main.c (goURL0): change args, def_url -> current * main.c (goURL0): delete ParsedURL *b_url * main.c (goURL0): add Buffer *cur_buf * main.c (goURL0): if current is supplied, use its URL as default * main.c (goURL0): add URL to history if loadURL succeeded * main.c (goURL): change args for goURL0() * main.c (gorURL): ditto From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--main.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/main.c b/main.c
index 8bfb53a..65e0756 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.69 2002/01/22 16:59:11 ukai Exp $ */
+/* $Id: main.c,v 1.70 2002/01/23 17:19:47 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -762,6 +762,8 @@ MAIN(int argc, char **argv, char **envp)
newbuf = loadGeneralFile(p, NULL, NO_REFERER, 0, NULL);
if (newbuf == NULL)
Strcat(err_msg, Sprintf("w3m: Can't load %s.\n", p));
+ else if (newbuf != NO_BUFFER)
+ pushHashHist(URLHist, parsedURL2Str(&newbuf->currentURL)->ptr);
}
else {
if (fmInitialized)
@@ -840,7 +842,6 @@ MAIN(int argc, char **argv, char **envp)
case SCM_LOCAL:
case SCM_LOCAL_CGI:
unshiftHist(LoadHist, conv_from_system(load_argv[i]));
- break;
default:
pushHashHist(URLHist, parsedURL2Str(&newbuf->currentURL)->ptr);
break;
@@ -3612,23 +3613,19 @@ cmd_loadURL(char *url, ParsedURL *current)
/* go to specified URL */
static void
-goURL0(char *prompt, char *def_url)
+goURL0(char *prompt, ParsedURL *current)
{
char *url;
ParsedURL p_url;
- ParsedURL *b_url;
+ Buffer *cur_buf = Currentbuf;
- b_url = baseURL(Currentbuf);
url = searchKeyData();
if (url == NULL) {
- if (!(Currentbuf->bufferprop & BP_INTERNAL))
- pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr);
- url = inputLineHist(prompt, def_url, IN_URL, URLHist);
- if (url != NULL) {
+ if (current)
+ url = parsedURL2Str(current)->ptr;
+ url = inputLineHist(prompt, url, IN_URL, URLHist);
+ if (url != NULL)
SKIP_BLANKS(url);
- if (def_url != NULL)
- b_url = NULL; /* XXX: for retryAsHttp */
- }
}
#ifdef JP_CHARSET
if (url != NULL) {
@@ -3646,21 +3643,23 @@ goURL0(char *prompt, char *def_url)
gotoLabel(url + 1);
return;
}
- parseURL2(url, &p_url, baseURL(Currentbuf));
+ parseURL2(url, &p_url, current);
pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr);
- cmd_loadURL(url, b_url);
+ cmd_loadURL(url, current);
+ if (Currentbuf != cur_buf) /* success */
+ pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr);
}
void
goURL(void)
{
- goURL0("Goto URL: ", parsedURL2Str(&Currentbuf->currentURL)->ptr);
+ goURL0("Goto URL: ", NULL);
}
void
gorURL(void)
{
- goURL0("Goto relative URL: ", NULL);
+ goURL0("Goto relative URL: ", baseURL(Currentbuf));
}
static void