summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-26 08:32:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-26 08:32:35 +0000
commit8369164408f2f9aa2984257f428f957876a84ced (patch)
tree200242150ac9ce61cc99d220002ff41111de87f9
parenta5dcc4437e3354996f8242503d678f0eb5193809 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c2
-rw-r--r--string.c4
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 34cb8a4d08..af5f1f0993 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,11 @@ Tue Dec 26 16:53:55 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (proc_new): ditto.
+Tue Dec 26 15:45:35 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_inspect): should treat multibyte chracters
+ properly.
+
Mon Dec 25 17:49:08 2000 K.Kosako <kosako@sofnec.co.jp>
* string.c (rb_str_replace_m): unexpected string share happens if
diff --git a/io.c b/io.c
index 8dcf258af9..c1a56f7732 100644
--- a/io.c
+++ b/io.c
@@ -2156,7 +2156,7 @@ rb_f_p(argc, argv)
for (i=0; i<argc; i++) {
rb_p(argv[i]);
}
- if (TYPE(rb_defout) != T_FILE) {
+ if (TYPE(rb_defout) == T_FILE) {
rb_io_flush(rb_defout);
}
return Qnil;
diff --git a/string.c b/string.c
index 5edac14e66..33afb982c3 100644
--- a/string.c
+++ b/string.c
@@ -1494,8 +1494,8 @@ rb_str_inspect(str)
char c = *p++;
if (ismbchar(c) && p < pend) {
int len = mbclen(c);
- rb_str_cat(result, p, len);
- p += len;
+ rb_str_cat(result, p - 1, len);
+ p += len - 1;
}
else if (c == '"'|| c == '\\') {
s[0] = '\\'; s[1] = c;