summaryrefslogtreecommitdiff
path: root/regerror.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 21:48:05 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 21:48:05 (GMT)
commitf4592d7bb0c88ab22e15e632afb70279f119af4e (patch)
tree86dcaf5e5f9fd60c13efee3612190c9ee1e04f06 /regerror.c
parent08eb58d3dd6543a44c798aacc4385bf9f8bc005d (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regerror.c')
-rw-r--r--regerror.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/regerror.c b/regerror.c
index 61187d4..cede3f8 100644
--- a/regerror.c
+++ b/regerror.c
@@ -197,7 +197,7 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
code = ONIGENC_MBC_TO_CODE(enc, p, end);
if (code >= 0x80) {
if (len + 5 <= buf_size) {
- sprintf((char* )(&(buf[len])), "\\%03o",
+ sprintf((char* )(&(buf[len])), "\\x%02x",
(unsigned int )(code & 0377));
len += 5;
}
@@ -346,7 +346,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
int blen;
while (len-- > 0) {
- sprintf((char* )bs, "\\%03o", *p++ & 0377);
+ sprintf((char* )bs, "\\x%02x", *p++ & 0377);
blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
bp = bs;
while (blen-- > 0) *s++ = *bp++;
@@ -355,7 +355,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
}
else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
!ONIGENC_IS_CODE_SPACE(enc, *p)) {
- sprintf((char* )bs, "\\%03o", *p++ & 0377);
+ sprintf((char* )bs, "\\x%02x", *p++ & 0377);
len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
bp = bs;
while (len-- > 0) *s++ = *bp++;