summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-03-12 19:18:29 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-03-12 19:18:29 +0100
commit08bffd6f5a7a34e556a7efeab58b229fd55e219c (patch)
tree5a805dec019e9b8046dc9fb5beca250ee7017216 /src
parent6c20e402dcb845f864ed07bad78a81077b2c2804 (diff)
downloadweechat-08bffd6f5a7a34e556a7efeab58b229fd55e219c.zip
exec: automatically disable shell if command starts with "url:" (URL download)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/exec/exec-command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/exec/exec-command.c b/src/plugins/exec/exec-command.c
index 6fd9d02e8..c56b540b4 100644
--- a/src/plugins/exec/exec-command.c
+++ b/src/plugins/exec/exec-command.c
@@ -505,6 +505,9 @@ exec_command_exec (void *data, struct t_gui_buffer *buffer, int argc,
exec_free (new_exec_cmd);
return WEECHAT_RC_ERROR;
}
+ /* automatically disable shell if we are downloading an URL */
+ if (strncmp (argv_eol[cmd_options.command_index], "url:", 4) == 0)
+ cmd_options.use_shell = 0;
if (cmd_options.use_shell)
{
/* command will be: sh -c "command arguments..." */
@@ -652,7 +655,9 @@ exec_command_init ()
" -nosw: don't switch to the output buffer\n"
"-timeout: set a timeout for the command (in seconds)\n"
" -name: set a name for the command (to name it later with /exec)\n"
- " command: the command to execute\n"
+ " command: the command to execute; if beginning with \"url:\", the "
+ "shell is disabled and the content of URL is downloaded and sent as "
+ "output\n"
" id: command identifier: either its number or name (if set "
"with \"-name xxx\")\n"
" -in: send text on standard input of process\n"