Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: mkdir builtin and $'\0'



On Tue, 18 Aug 2015 12:11:34 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> $ strftime $'%Y\0%m\0%d' 0 | sed -n l
> 1970\203 01\203 01$

This should fix that one.

pws

diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c
index d941667..f5a47e3 100644
--- a/Src/Modules/datetime.c
+++ b/Src/Modules/datetime.c
@@ -140,7 +140,8 @@ output_strftime(char *nam, char **argv, Options ops, UNUSED(int func))
     if (scalar) {
 	setsparam(scalar, metafy(buffer, -1, META_DUP));
     } else {
-	printf("%s\n", buffer);
+	zputs(buffer, stdout);
+	putchar('\n');
     }
     zfree(buffer, bufsize);
 



Messages sorted by: Reverse Date, Date, Thread, Author