From ca22b785992df70ddc30ec471484e0204a384277 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 25 Dec 2011 10:06:42 +0100 Subject: [PATCH] * callint.c (Fcall_interactively): Don't truncate prompt string. --- src/ChangeLog | 4 ++++ src/callint.c | 11 ++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3a0264e394b..a1210e08424 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-12-24 Andreas Schwab + + * callint.c (Fcall_interactively): Don't truncate prompt string. + 2011-12-23 Eli Zaretskii * xdisp.c (handle_invisible_prop): Handle correctly an invisible diff --git a/src/callint.c b/src/callint.c index 80e24f6c8ee..25a4713e270 100644 --- a/src/callint.c +++ b/src/callint.c @@ -274,8 +274,6 @@ invoke it. If KEYS is omitted or nil, the return value of ptrdiff_t i, nargs; int foo; - char prompt1[100]; - char *tem1; int arg_from_tty = 0; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; int key_count; @@ -491,13 +489,8 @@ invoke it. If KEYS is omitted or nil, the return value of tem = string; for (i = 1; *tem; i++) { - strncpy (prompt1, tem + 1, sizeof prompt1 - 1); - prompt1[sizeof prompt1 - 1] = 0; - tem1 = strchr (prompt1, '\n'); - if (tem1) *tem1 = 0; - - visargs[0] = build_string (prompt1); - if (strchr (prompt1, '%')) + visargs[0] = make_string (tem + 1, strcspn (tem + 1, "\n")); + if (strchr (SSDATA (visargs[0]), '%')) callint_message = Fformat (i, visargs); else callint_message = visargs[0]; -- 2.39.2