Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] zstat: double metafy fix
> 2018/11/14 13:0, ivan tkachenko <me@xxxxxxxxxx> 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, ")");
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author