[w3m-dev 03783] pipe to "command1 | command2"
* etc.c (myExtCommand): redirect to subshell * main.c (pipeBuf): conv_to_system(cmd) shell_quote() set buf->filename, buf->buffername
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2003-02-27 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03783] pipe to "command1 | command2"
|
||||||
|
* etc.c (myExtCommand): redirect to subshell
|
||||||
|
* main.c (pipeBuf): conv_to_system(cmd)
|
||||||
|
shell_quote()
|
||||||
|
set buf->filename, buf->buffername
|
||||||
|
|
||||||
2003-02-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
2003-02-26 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 03782] real linenumber for EDIT and EDIT_SCREEN
|
* [w3m-dev 03782] real linenumber for EDIT and EDIT_SCREEN
|
||||||
@@ -7263,4 +7271,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.766 2003/02/25 16:05:43 ukai Exp $
|
$Id: ChangeLog,v 1.767 2003/02/26 17:22:01 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: etc.c,v 1.66 2003/02/18 15:44:33 ukai Exp $ */
|
/* $Id: etc.c,v 1.67 2003/02/26 17:22:02 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include "myctype.h"
|
#include "myctype.h"
|
||||||
@@ -1495,8 +1495,12 @@ myExtCommand(char *cmd, char *arg, int redirect)
|
|||||||
Strcat_char(tmp, *p);
|
Strcat_char(tmp, *p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!set_arg)
|
if (!set_arg) {
|
||||||
tmp = Strnew_m_charp(cmd, (redirect ? " < " : " "), arg, NULL);
|
if (redirect)
|
||||||
|
tmp = Strnew_m_charp("(", cmd, ") < ", arg, NULL);
|
||||||
|
else
|
||||||
|
tmp = Strnew_m_charp(cmd, " ", arg, NULL);
|
||||||
|
}
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: main.c,v 1.214 2003/02/25 16:06:57 ukai Exp $ */
|
/* $Id: main.c,v 1.215 2003/02/26 17:22:03 ukai Exp $ */
|
||||||
#define MAINPROGRAM
|
#define MAINPROGRAM
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@@ -1895,10 +1895,12 @@ pipeBuf(void)
|
|||||||
cmd = searchKeyData();
|
cmd = searchKeyData();
|
||||||
if (cmd == NULL || *cmd == '\0') {
|
if (cmd == NULL || *cmd == '\0') {
|
||||||
cmd = inputLineHist("Pipe buffer to: ", "", IN_COMMAND, ShellHist);
|
cmd = inputLineHist("Pipe buffer to: ", "", IN_COMMAND, ShellHist);
|
||||||
if (cmd == NULL || *cmd == '\0') {
|
}
|
||||||
displayBuffer(Currentbuf, B_NORMAL);
|
if (cmd != NULL)
|
||||||
return;
|
cmd = conv_to_system(cmd);
|
||||||
}
|
if (cmd == NULL || *cmd == '\0') {
|
||||||
|
displayBuffer(Currentbuf, B_NORMAL);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
tmpf = tmpfname(TMPF_DFL, NULL)->ptr;
|
tmpf = tmpfname(TMPF_DFL, NULL)->ptr;
|
||||||
f = fopen(tmpf, "w");
|
f = fopen(tmpf, "w");
|
||||||
@@ -1908,12 +1910,15 @@ pipeBuf(void)
|
|||||||
}
|
}
|
||||||
saveBuffer(Currentbuf, f, TRUE);
|
saveBuffer(Currentbuf, f, TRUE);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
buf = getpipe(myExtCommand(cmd, tmpf, TRUE)->ptr);
|
buf = getpipe(myExtCommand(cmd, shell_quote(tmpf), TRUE)->ptr);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
disp_message("Execution failed", TRUE);
|
disp_message("Execution failed", TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
buf->filename = cmd;
|
||||||
|
buf->buffername = Sprintf("%s %s", PIPEBUFFERNAME,
|
||||||
|
conv_from_system(cmd))->ptr;
|
||||||
buf->bufferprop |= (BP_INTERNAL | BP_NO_URL);
|
buf->bufferprop |= (BP_INTERNAL | BP_NO_URL);
|
||||||
if (buf->type == NULL)
|
if (buf->type == NULL)
|
||||||
buf->type = "text/plain";
|
buf->type = "text/plain";
|
||||||
|
|||||||
Reference in New Issue
Block a user