From: Alexey Gladkov <gladkov.alexey@gmail.com>
To: dash@vger.kernel.org
Subject: [PATCH] [BUILTIN] Fix corruption of reads with byte 0x81
Date: Thu, 24 Feb 2011 14:43:44 +0300 [thread overview]
Message-ID: <4D664470.7070707@gmail.com> (raw)
In-Reply-To: <4D5C4EE2.9060504@gmail.com>
Starting with commit 55c46b dash removes CTLESC bytes ('\x81')
from read sequence. This leads to breakage of some UTF8
characters. Like in commit f8231a, this change fixes corruption
by removing the faulty code.
Testcase:
$ /usr/bin/printf '[\u0441]\n'
[с]
$ /usr/bin/printf '[\u0441]\n' |dash -c 'read c; printf "%s\n" "$c"'
[Ñ]
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
---
src/miscbltin.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/miscbltin.c b/src/miscbltin.c
index 653c92f..4e88e8d 100644
--- a/src/miscbltin.c
+++ b/src/miscbltin.c
@@ -112,14 +112,12 @@ 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;
}
/* set variable to field */
- rmescapes(sl->text);
setvar(*ap, sl->text, 0);
sl = sl->next;
} while (*++ap);
--
1.7.3.5
next prev parent reply other threads:[~2011-02-24 11:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 22:25 dash breaks u0441 Alexey Gladkov
2011-02-24 11:43 ` Alexey Gladkov [this message]
2011-03-10 13:01 ` [PATCH] [BUILTIN] Fix corruption of reads with byte 0x81 Herbert Xu
2011-03-11 0:04 ` Jilles Tjoelker
2011-03-11 3:40 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D664470.7070707@gmail.com \
--to=gladkov.alexey@gmail.com \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox