From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id c0074f8f for ; Thu, 15 Nov 2018 02:28:18 +0000 (UTC) Received: (qmail 3513 invoked by alias); 15 Nov 2018 02:28:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43826 Received: (qmail 15748 invoked by uid 1010); 15 Nov 2018 02:28:08 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(133.208.100.1):SA:0(-2.6/5.0):. Processed in 5.363134 secs); 15 Nov 2018 02:28:08 -0000 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Biglobe-Sender: From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: [PATCH] zstat: double metafy fix Date: Thu, 15 Nov 2018 10:47:14 +0900 References: <76470381542168446@iva5-750e13568e4d.qloud-c.yandex.net> To: ivan tkachenko , zsh-workers@zsh.org In-Reply-To: <76470381542168446@iva5-750e13568e4d.qloud-c.yandex.net> Message-Id: <9569062C-D85E-4379-8C81-FC4C763B3460@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3445.101.1) X-Biglobe-Spnum: 60211 > 2018/11/14 13:0, ivan tkachenko wrote: >=20 > I've found and successfully fixed a bug of double escaping formatted = time in > `zstat` builtin with the patch below.=20 Thanks, and Yes, the metafy() there should be removed. #the string need be metafy()ed only for 'zstat -A array_name' =20 I will push the following (i.e., remove the unused variable 'len') Jun diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c index 50a6a9bb2..7c736072b 100644 --- a/Src/Modules/stat.c +++ b/Src/Modules/stat.c @@ -198,10 +198,8 @@ stattimeprint(time_t tim, long nsecs, char *outbuf, = int flags) if (flags & STF_STRING) { char *oend =3D outbuf + strlen(outbuf); /* Where the heck does "40" come from? */ - int len =3D ztrftime(oend, 40, timefmt, (flags & STF_GMT) ? = gmtime(&tim) : + ztrftime(oend, 40, timefmt, (flags & STF_GMT) ? gmtime(&tim) : localtime(&tim), nsecs); - if (len > 0) - metafy(oend, len, META_NOALLOC); if (flags & STF_RAW) strcat(oend, ")"); }