summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 21:48:05 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 21:48:05 +0000
commit401874e72b3fe322a2137f4f48963ad037b016cb (patch)
tree86dcaf5e5f9fd60c13efee3612190c9ee1e04f06 /string.c
parentd64e9d6b38bc7acf26a4ba4d91403d1c9135d20a (diff)
downloadruby-401874e72b3fe322a2137f4f48963ad037b016cb.tar.gz
ruby-401874e72b3fe322a2137f4f48963ad037b016cb.tar.xz
ruby-401874e72b3fe322a2137f4f48963ad037b016cb.zip
* re.c (rb_reg_expr_str): use \xHH instead of \OOO.
* regerror.c (to_ascii): ditto. (onig_snprintf_with_pattern): ditto. (onig_snprintf_with_pattern): ditto. * string.c (rb_str_inspect): ditto. (rb_str_dump): ditto. * parse.y (parser_yylex): ditto. * ruby.c (proc_options): ditto. * file.c (rb_f_test): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index b716c16b1..a6f8bf116 100644
--- a/string.c
+++ b/string.c
@@ -2971,7 +2971,7 @@ rb_str_inspect(VALUE str)
escape_codepoint:
for (q = p-n; q < p; q++) {
s = buf;
- sprintf(buf, "\\%03o", *q & 0377);
+ sprintf(buf, "\\x%02x", *q & 0377);
while (*s) {
str_cat_char(result, *s++, enc);
}
@@ -3083,7 +3083,7 @@ rb_str_dump(VALUE str)
}
else {
*q++ = '\\';
- sprintf(q, "%03o", c&0xff);
+ sprintf(q, "x%02x", c&0xff);
q += 3;
}
}