aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-22 16:59:11 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-22 16:59:11 +0000
commit7b85bcab2fa0943dbf135725b9146dcfa3ca45f6 (patch)
tree546f2ed8a9e63575a7459c895d3c1178681178df /main.c
parent[w3m-dev-en 00670] GOTO behavior change (diff)
downloadw3m-7b85bcab2fa0943dbf135725b9146dcfa3ca45f6.tar.gz
w3m-7b85bcab2fa0943dbf135725b9146dcfa3ca45f6.zip
[w3m-dev 02885] Re: goURL
* funcname.tab (GOTO_RELATIVE): added * main.c (goURL0): renamed from goURL don't add http:// here, if base URL is NULL, cmd_loadURL() will add http:// when necessary * main.c (goURL): go to URL with current URL * main.c (gorURL): go to relative URL * proto.h (gorURL): added * doc/README.func (GOTO_RELATIVE): added * doc-jp/README.func (GOTO_RELATIVE): ditto From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'main.c')
-rw-r--r--main.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/main.c b/main.c
index e2a320f..8bfb53a 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.68 2002/01/22 10:45:14 ukai Exp $ */
+/* $Id: main.c,v 1.69 2002/01/22 16:59:11 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -3611,28 +3611,23 @@ cmd_loadURL(char *url, ParsedURL *current)
/* go to specified URL */
-void
-goURL(void)
+static void
+goURL0(char *prompt, char *def_url)
{
char *url;
ParsedURL p_url;
+ ParsedURL *b_url;
+ b_url = baseURL(Currentbuf);
url = searchKeyData();
if (url == NULL) {
- Str cur_url = parsedURL2Str(&Currentbuf->currentURL);
- ParsedURL pu;
if (!(Currentbuf->bufferprop & BP_INTERNAL))
- pushHashHist(URLHist, cur_url->ptr);
- url = inputLineHist("Goto URL: ", cur_url->ptr, IN_URL, URLHist);
+ pushHashHist(URLHist, parsedURL2Str(&Currentbuf->currentURL)->ptr);
+ url = inputLineHist(prompt, def_url, IN_URL, URLHist);
if (url != NULL) {
SKIP_BLANKS(url);
- parseURL(url, &pu, NULL);
- if (retryAsHttp) {
- if ((pu.scheme == SCM_MISSING)
- || ((pu.scheme == SCM_LOCAL)
- && (strncmp(url, "file:", 5) != 0)))
- url = Sprintf("http://%s", url)->ptr;
- }
+ if (def_url != NULL)
+ b_url = NULL; /* XXX: for retryAsHttp */
}
}
#ifdef JP_CHARSET
@@ -3653,7 +3648,19 @@ goURL(void)
}
parseURL2(url, &p_url, baseURL(Currentbuf));
pushHashHist(URLHist, parsedURL2Str(&p_url)->ptr);
- cmd_loadURL(url, baseURL(Currentbuf));
+ cmd_loadURL(url, b_url);
+}
+
+void
+goURL(void)
+{
+ goURL0("Goto URL: ", parsedURL2Str(&Currentbuf->currentURL)->ptr);
+}
+
+void
+gorURL(void)
+{
+ goURL0("Goto relative URL: ", NULL);
}
static void