From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: ivan tkachenko <me@ratijas.tk>, zsh-workers@zsh.org
Subject: Re: [PATCH] zstat: double metafy fix
Date: Thu, 15 Nov 2018 10:47:14 +0900 [thread overview]
Message-ID: <9569062C-D85E-4379-8C81-FC4C763B3460@kba.biglobe.ne.jp> (raw)
In-Reply-To: <76470381542168446@iva5-750e13568e4d.qloud-c.yandex.net>
> 2018/11/14 13:0, ivan tkachenko <me@ratijas.tk> wrote:
>
> I've found and successfully fixed a bug of double escaping formatted time in
> `zstat` builtin with the patch below.
Thanks, and Yes, the metafy() there should be removed.
#the string need be metafy()ed only for 'zstat -A array_name'
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 = outbuf + strlen(outbuf);
/* Where the heck does "40" come from? */
- int len = 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, ")");
}
prev parent reply other threads:[~2018-11-15 2:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 4:07 ivan tkachenko
2018-11-15 1:47 ` Jun T [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9569062C-D85E-4379-8C81-FC4C763B3460@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=me@ratijas.tk \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).