w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit dd78533844d757a97335e62485d8cb58d09829d9
parent 7c485829a11165f3f5a3f3904a2c2d6e2e066779
Author: ukai <ukai>
Date:   Fri, 22 Mar 2002 15:35:44 +0000

[w3m-dev 03140] Forward: Bug#139305:
   w3m: EXTERN_LINK does not work if href ends with ampersand
* main.c (invoke_browser): check bg by browser
From: Kiyokazu SUTO <suto@ks-and-ks.ne.jp>

Diffstat:
MChangeLog | 6++++++
Mmain.c | 21+++++++++++----------
2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,9 @@ +2002-03-23 Kiyokazu SUTO <suto@ks-and-ks.ne.jp> + + * [w3m-dev 03140] Forward: Bug#139305: + w3m: EXTERN_LINK does not work if href ends with ampersand + * main.c (invoke_browser): check bg by browser + 2002-03-21 Fumitoshi UKAI <ukai@debian.or.jp> * terms.c (term_title): use ttyf instead of stderr diff --git a/main.c b/main.c @@ -4439,7 +4439,7 @@ invoke_browser(char *url) { Str cmd; char *browser = NULL; - int bg = 0; + int bg = 0, len; CurrentKeyData = NULL; /* not allowed in w3m-control: */ browser = searchKeyData(); @@ -4468,12 +4468,13 @@ invoke_browser(char *url) if (browser == NULL || *browser == '\0') return; - cmd = myExtCommand(browser, shell_quote(url), FALSE); - Strremovetrailingspaces(cmd); - if (Strlastchar(cmd) == '&') { - Strshrink(cmd, 1); + if ((len = strlen(browser)) >= 2 && browser[len - 1] == '&' && + browser[len - 2] != '\\') { + browser = allocStr(browser, len - 2); bg = 1; } + cmd = myExtCommand(browser, shell_quote(url), FALSE); + Strremovetrailingspaces(cmd); fmTerm(); mySystem(cmd->ptr, bg); fmInit(); @@ -4988,10 +4989,10 @@ execCmd(void) data = searchKeyData(); if (data == NULL || *data == '\0') { data = inputStrHist("command [; ...]: ", "", TextHist); - if (data == NULL) { - displayBuffer(Currentbuf, B_NORMAL); - return; - } + if (data == NULL) { + displayBuffer(Currentbuf, B_NORMAL); + return; + } } /* data: FUNC [DATA] [; FUNC [DATA] ...] */ while (*data) { @@ -5042,7 +5043,7 @@ SigAlarm(SIGNAL_ARG) CurrentCmdData = NULL; onA(); disp_message_nsec(Sprintf("%s %s", w3mFuncList[alarm_event.cmd].id, - CurrentCmdData ? CurrentCmdData : "")->ptr, + CurrentCmdData ? CurrentCmdData : "")->ptr, FALSE, alarm_sec - 1, FALSE, TRUE); if (alarm_status == AL_IMPLICIT) { alarm_buffer = Currentbuf;