diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-16 02:05:37 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-16 02:05:37 +0000 |
commit | 0a08782b12b384aea0ea5bf8921d8976931cb11f (patch) | |
tree | 064b56c82fc5223920205295bc7e9e4bcf0688c5 /re.c | |
parent | eb0761408524b45266940fc02c86cf3a0f5b87af (diff) |
merge revision(s) 49058: [Backport #10670]
* re.c (unescape_nonascii): append excape sequence as-is not
unescaped character, to get rid of unexpected meta-character.
[ruby-core:67193] [Bug #10670]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2298,9 +2298,10 @@ unescape_nonascii(const char *p, const char *end, rb_encoding *enc, case 'M': /* \M-X, \M-\C-X, \M-\cX */ p = p-2; if (enc == rb_usascii_encoding()) { + const char *pbeg = p; c = read_escaped_byte(&p, end, err); if (c == (char)-1) return -1; - rb_str_buf_cat(buf, &c, 1); + rb_str_buf_cat(buf, pbeg, p-pbeg); } else { if (unescape_escaped_nonascii(&p, end, enc, buf, encp, err) != 0) |