[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>
This commit is contained in:
Fumitoshi UKAI
2002-03-22 15:35:44 +00:00
parent 7d9c4711a4
commit 69649838b1
2 changed files with 19 additions and 12 deletions
+7 -1
View File
@@ -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
@@ -3281,4 +3287,4 @@
* release-0-2-1
* import w3m-0.2.1
$Id: ChangeLog,v 1.359 2002/03/20 17:53:00 ukai Exp $
$Id: ChangeLog,v 1.360 2002/03/22 15:35:44 ukai Exp $
+7 -6
View File
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.91 2002/03/19 16:06:52 ukai Exp $ */
/* $Id: main.c,v 1.92 2002/03/22 15:35:44 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -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();