summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-11-22 18:13:19 +0000
committersabetts <sabetts>2004-11-22 18:13:19 +0000
commit23273b03bb7dd46cdab919031cee47e1ccc29c7c (patch)
treeb932fd375c95a059d088708fb2aed9cac18ebd60 /src/actions.c
parent8d9a70922f079696e33ca3eda9d34cb4c5efaaa1 (diff)
downloadratpoison-23273b03bb7dd46cdab919031cee47e1ccc29c7c.zip
* src/actions.c (cmd_verbexec): rewritten to fix crash bug.
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/actions.c b/src/actions.c
index 67e24d2..0cfe727 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -3875,11 +3875,21 @@ cmd_frestore (int interactively, char *data)
char *
cmd_verbexec (int interactive, char *data)
{
- char msg[100]="Running ";
- strncat(msg, data, 100-strlen(msg));
-
- if(data) cmd_echo(interactive, msg);
- return cmd_exec(interactive, data);
+ char *cmd;
+
+ if (data == NULL)
+ cmd = get_input (MESSAGE_PROMPT_SHELL_COMMAND, exec_completions);
+ else
+ cmd = xstrdup (data);
+
+ /* User aborted. */
+ if (cmd == NULL)
+ return NULL;
+
+ marked_message_printf(0, 0, " Running %s ", cmd);
+ spawn (cmd);
+ free (cmd);
+ return NULL;
}
static char *