From 1d38a821eaad46cd649a911b38a7d3540d6df8a9 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 22 Oct 2008 04:27:32 +0000 Subject: * re.c (unescape_escaped_nonascii): back out the last change on the function. [ruby-dev:36818] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- re.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index bd598ddf66..465e12c8c2 100644 --- a/re.c +++ b/re.c @@ -1967,12 +1967,8 @@ unescape_escaped_nonascii(const char **pp, const char *end, rb_encoding *enc, l = rb_enc_precise_mbclen(chbuf, chbuf+chlen, enc); if (MBCLEN_INVALID_P(l)) { - if (*encp == 0) - enc = *encp = rb_ascii8bit_encoding(); - else if (*encp != rb_ascii8bit_encoding()) { - strcpy(err, "invalid multibyte escape"); - return -1; - } + strcpy(err, "invalid multibyte escape"); + return -1; } if (1 < chlen || (chbuf[0] & 0x80)) { rb_str_buf_cat(buf, chbuf, chlen); -- cgit v1.2.3