4 source/macro.c | 7 ++++---
5 2 files changed, 7 insertions(+), 5 deletions(-)
7 diff --quilt old/source/macro.c new/source/macro.c
10 @@ -2781,17 +2781,18 @@ static int getenvMS(WindowInfo *window,
13 static int shellCmdMS(WindowInfo *window, DataValue *argList, int nArgs,
14 DataValue *result, char **errMsg)
16 - char stringStorage[2][TYPE_INT_STR_SIZE(int)], *cmdString, *inputString;
17 + char stringStorage[2][TYPE_INT_STR_SIZE(int)], *cmdString, *inputString = "";
20 + if (nArgs != 1 || nArgs != 2)
21 return wrongNArgsErr(errMsg);
22 if (!readStringArg(argList[0], &cmdString, stringStorage[0], errMsg))
24 - if (!readStringArg(argList[1], &inputString, stringStorage[1], errMsg))
26 + !readStringArg(argList[1], &inputString, stringStorage[1], errMsg))
29 /* Shell command execution requires that the macro be suspended, so
30 this subroutine can't be run if macro execution can't be interrupted */
31 if (MacroRunWindow()->macroCmdData == NULL) {
32 diff --quilt old/doc/help.etx new/doc/help.etx
35 @@ -2691,14 +2691,15 @@ Macro Subroutines
38 **set_cursor_pos( position )**
39 Set the cursor position for the current window.
41 -**shell_command( command, input_string )**
42 +**shell_command( command[, input_string] )**
43 Executes a shell command, feeding it input from input_string. On completion,
44 output from the command is returned as the function value, and the command's
45 - exit status is returned in the global variable $shell_cmd_status.
46 + exit status is returned in the global variable $shell_cmd_status. If the
47 + input_string is ommited or is "" the shell command get no input.
49 **split(string, separation_string [, search_type])**
50 Splits a string using the separator specified. Optionally the search_type
51 argument can specify how the separation_string is interpreted. The default
52 is "literal". The returned value is an array with keys beginning at 0.