summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/execute.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 10e9dd7cc8..0273b1966f 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -722,6 +722,7 @@ enum {
static int ask_for_confirmation(const char *vc, const char *cmdline) {
int saved_stdout = -1, saved_stdin = -1, r;
+ _cleanup_free_ char *e = NULL;
char c;
/* For any internal errors, assume a positive response. */
@@ -731,7 +732,14 @@ static int ask_for_confirmation(const char *vc, const char *cmdline) {
return CONFIRM_EXECUTE;
}
- r = ask_char(&c, "yfs", "Execute %s? [Yes, Fail, Skip] ", cmdline);
+ e = ellipsize(cmdline, 60, 100);
+ if (!e) {
+ log_oom();
+ r = CONFIRM_EXECUTE;
+ goto restore_stdio;
+ }
+
+ r = ask_char(&c, "yfs", "Execute %s? [Yes, Fail, Skip] ", e);
if (r < 0) {
write_confirm_error_fd(r, STDOUT_FILENO);
r = CONFIRM_EXECUTE;