From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: Puzzling behavior from echo area: truncates prompt string at 100 characters? Date: Sat, 24 Dec 2011 11:59:36 +0100 Message-ID: References: <83liq2xqm3.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1324724390 16869 80.91.229.12 (24 Dec 2011 10:59:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Dec 2011 10:59:50 +0000 (UTC) Cc: Tom Davey , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 24 11:59:46 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RePKM-0001uG-4K for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2011 11:59:46 +0100 Original-Received: from localhost ([::1]:50625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RePKL-0006SJ-NV for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2011 05:59:45 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RePKI-0006SB-SG for emacs-devel@gnu.org; Sat, 24 Dec 2011 05:59:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RePKH-00079R-S2 for emacs-devel@gnu.org; Sat, 24 Dec 2011 05:59:42 -0500 Original-Received: from mail-out.m-online.net ([212.18.0.10]:40908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RePKG-00078q-AS; Sat, 24 Dec 2011 05:59:40 -0500 Original-Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id EF6A51802F0E; Sat, 24 Dec 2011 11:59:36 +0100 (CET) X-Auth-Info: 3ZlQbnRl6c/dsCttAUsXOKYBro95Om3KMHEf2Ce2+pc= Original-Received: from igel.home (ppp-88-217-98-198.dynamic.mnet-online.de [88.217.98.198]) by mail.mnet-online.de (Postfix) with ESMTPA id 4F12B1C0005F; Sat, 24 Dec 2011 11:59:37 +0100 (CET) Original-Received: by igel.home (Postfix, from userid 501) id 9A667CA29C; Sat, 24 Dec 2011 11:59:36 +0100 (CET) X-Yow: I'm changing the CHANNEL.. But all I get is commercials for ``RONCO MIRACLE BAMBOO STEAMERS''! In-Reply-To: <83liq2xqm3.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Dec 2011 11:31:48 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 212.18.0.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146956 Archived-At: Eli Zaretskii writes: > This limitation was there since 1991, but AFAICS it is not documented > anywhere. I don't think this was a deliberate decision, just sloppy coding. > Do we want to keep this limitation? If so, it should be at least > documented. I can trivially be lifted: diff --git a/src/callint.c b/src/callint.c index 80e24f6..8dcf9a6 100644 --- a/src/callint.c +++ b/src/callint.c @@ -274,7 +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; @@ -491,13 +490,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]; Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."