[PATCH] fix UTF-8 issues in read() builtin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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. 
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;

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux