DASH Shell discussions
 help / color / mirror / Atom feed
* [PATCH] fix UTF-8 issues in read() builtin
@ 2010-09-07 21:26 Alexey Zinovyev
  2010-09-07 22:57 ` Jilles Tjoelker
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Zinovyev @ 2010-09-07 21:26 UTC (permalink / raw)
  To: dash

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

Hello, I think there is a bug in read() builtin.

$ cat test
echo 'ρ'|while read i; do echo $i; done
$ dash test

$ bash test
ρ

Same with some japanese symbols.
Looks like dash strips 0x81 byte. 

[-- Attachment #2: dash-read-fix.patch --]
[-- Type: text/plain, Size: 378 bytes --]

diff --git a/src/miscbltin.c b/src/miscbltin.c
index 5ab1648..f8c5655 100644
--- a/src/miscbltin.c
+++ b/src/miscbltin.c
@@ -101,7 +101,6 @@ readcmd_handle_line(char *line, char **ap, size_t len)
 			 * will not modify the length of the string */
 			offset = sl->text - s;
 			remainder = backup + offset;
-			rmescapes(remainder);
 			setvar(*ap, remainder, 0);
 
 			return;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-07 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 21:26 [PATCH] fix UTF-8 issues in read() builtin Alexey Zinovyev
2010-09-07 22:57 ` Jilles Tjoelker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox