summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-09 07:57:00 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-09 07:57:00 +0000
commit2b6ab941234426b8891f1bad036fd75611038312 (patch)
tree22ae6172fcc75cb8073529cb7f2719b11f0cf036 /string.c
parent6a3fdf70f18a7b67808f23ddbd28e9631f7f905a (diff)
1.1b9_00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/string.c b/string.c
index 2b6295cfbc2..6bd63c096c1 100644
--- a/string.c
+++ b/string.c
@@ -1375,11 +1375,15 @@ str_inspect(str)
while (p < pend) {
UCHAR c = *p++;
- if (ismbchar(c) && p < pend && ismbchar2(*p)) {
+ if (ismbchar(c) && p < pend) {
CHECK(2);
*b++ = c;
*b++ = *p++;
}
+ if (c & 0x80) {
+ CHECK(1);
+ *b++ = c;
+ }
else if (c == '"') {
CHECK(2);
*b++ = '\\';