aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-03-22 15:35:44 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-03-22 15:35:44 +0000
commit69649838b13adaf2f3c1ad413e270b0a487d148c (patch)
treeb4dc1dfce1d2ece55b46e638e4d94242a134d1fd /main.c
parentindent fix (diff)
downloadw3m-69649838b13adaf2f3c1ad413e270b0a487d148c.tar.gz
w3m-69649838b13adaf2f3c1ad413e270b0a487d148c.zip
[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 (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/main.c b/main.c
index 1b5c517..db07416 100644
--- a/main.c
+++ b/main.c
@@ -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();
@@ -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;