From f4592d7bb0c88ab22e15e632afb70279f119af4e Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 9 Dec 2007 21:48:05 +0000 Subject: * 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 --- regerror.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'regerror.c') diff --git a/regerror.c b/regerror.c index 61187d4a61..cede3f8da6 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++; -- cgit v1.2.1