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

PATCH: needs zputs() for output of dirs -l



Hi,

I found non-first line of "dirs -l" output is corrupted when dirname
includes some Japanese (UTF-8) characters.  First line is OK.

I checked the source and history, then it seems one more "fputs() to
zputs() conversion" at dc060607e9d9de14f6be02a27a4b54a2643d03a8
commit is there.

This patch fixes this, at least my environment.

diff --git a/Src/builtin.c b/Src/builtin.c
index ad3a192..264169c 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -719,7 +719,7 @@ bin_dirs(UNUSED(char *name), char **argv, Options ops, UNUSED(int func))
 	for (node = firstnode(dirstack); node; incnode(node)) {
 	    printf(fmt, pos++);
 	    if (OPT_ISSET(ops,'l'))
-		fputs(getdata(node), stdout);
+		zputs(getdata(node), stdout);
 	    else
 		fprintdir(getdata(node), stdout);
 



-- 
Jun Kuriyama <kuriyama@xxxxxxxxxxx> // FreeBSD Project
         <kuriyama@xxxxxxxxxxxxxxx> // S2 Factory, Inc.



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