about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2006-01-13 09:15:59 +0000
committerWayne Davison <wayned@users.sourceforge.net>2006-01-13 09:15:59 +0000
commit39b3d2b90a7c394ab2aabc3cd1a21d144265715c (patch)
treecbf5f85e2154bc9955476057a03220e15068d543
parent7c9c5bff0da245f710bea8f41d1d2d30cc5230d4 (diff)
downloadzsh-39b3d2b90a7c394ab2aabc3cd1a21d144265715c.tar.gz
zsh-39b3d2b90a7c394ab2aabc3cd1a21d144265715c.tar.xz
zsh-39b3d2b90a7c394ab2aabc3cd1a21d144265715c.zip
Values being stored in an array or a hash needed to be metafied
(using META_DUP) instead of just duplicated via ztrdup().
-rw-r--r--Src/Modules/stat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Src/Modules/stat.c b/Src/Modules/stat.c
index 01a050703..0c56aea76 100644
--- a/Src/Modules/stat.c
+++ b/Src/Modules/stat.c
@@ -200,7 +200,7 @@ stattimeprint(time_t tim, char *outbuf, int flags)
 	ztrftime(oend, 40, timefmt, (flags & STF_GMT) ? gmtime(&tim) :
 		 localtime(&tim));
 	if (flags & STF_RAW)
-	    strcat(outbuf, ")");
+	    strcat(oend, ")");
     }
 }
 
@@ -570,11 +570,11 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
 	if (iwhich > -1) {
 	    statprint(&statbuf, outbuf, *args, iwhich, flags);
 	    if (arrnam)
-		*arrptr++ = ztrdup(outbuf);
+		*arrptr++ = metafy(outbuf, -1, META_DUP);
 	    else if (hashnam) {
 		/* STF_NAME explicitly turned off for ops.ind['H'] above */
 	    	*hashptr++ = ztrdup(statelts[iwhich]);
-		*hashptr++ = ztrdup(outbuf);
+		*hashptr++ = metafy(outbuf, -1, META_DUP);
 	    } else
 		printf("%s\n", outbuf);
 	} else {
@@ -582,11 +582,11 @@ bin_stat(char *name, char **args, Options ops, UNUSED(int func))
 	    for (i = 0; i < ST_COUNT; i++) {
 		statprint(&statbuf, outbuf, *args, i, flags);
 		if (arrnam)
-		    *arrptr++= ztrdup(outbuf);
+		    *arrptr++= metafy(outbuf, -1, META_DUP);
 		else if (hashnam) {
 		    /* STF_NAME explicitly turned off for ops.ind['H'] above */
 		    *hashptr++ = ztrdup(statelts[i]);
-		    *hashptr++ = ztrdup(outbuf);
+		    *hashptr++ = metafy(outbuf, -1, META_DUP);
 		} else
 		    printf("%s\n", outbuf);
 	    }