Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: needs zputs() for output of dirs -l
- X-seq: zsh-workers 33984
- From: Jun Kuriyama <kuriyama@xxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: needs zputs() for output of dirs -l
- Date: Wed, 17 Dec 2014 15:18:01 +0900
- Cc: Jun Kuriyama <kuriyama@xxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=s2factory.co.jp; s=default; t=1418797081; bh=lK+UbOP8hAkpeDph5Wx8mz/DaucN5P7DcyfFmEIlhP4=; h=Date:From:To:Cc:Subject; b=uoIvQY8q/DxFWvp19LXO4TLLeI8X25meCU7N08/JRVz0NqRbYJrEYX4O7+2+jbt/E cBmL5t7hLQPFIWx8awZ4KKKvTnmgUhbHlXOMEmuDkpzB8vzF0GiJKUfwX6riTfYqbV S8FCoZFsP7uqmxgV17xXWDo9oGmXCvyPDvnNPHls=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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