* re.c (unescape_escaped_nonascii): fix mbclen argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
040e3e7bdd
commit
c650096adf
@ -1,3 +1,7 @@
|
||||
Sun Dec 2 20:43:22 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* re.c (unescape_escaped_nonascii): fix mbclen argument.
|
||||
|
||||
Sun Dec 2 15:47:57 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_tokadd_mbchar): check insufficient multibyte char.
|
||||
|
4
re.c
4
re.c
@ -1373,7 +1373,7 @@ unescape_escaped_nonascii(const char **pp, const char *end, rb_encoding *enc,
|
||||
}
|
||||
|
||||
chbuf[chlen++] = byte;
|
||||
while (chlen < chmaxlen && chlen != mbclen(chbuf, chbuf+chmaxlen, enc)) {
|
||||
while (chlen < chmaxlen && chlen != mbclen(chbuf, chbuf+chlen, enc)) {
|
||||
byte = read_escaped_byte(&p, end, err);
|
||||
if (byte == -1) {
|
||||
return -1;
|
||||
@ -1381,7 +1381,7 @@ unescape_escaped_nonascii(const char **pp, const char *end, rb_encoding *enc,
|
||||
chbuf[chlen++] = byte;
|
||||
}
|
||||
|
||||
if (chlen != mbclen(chbuf, chbuf+chmaxlen, enc)) {
|
||||
if (chlen != mbclen(chbuf, chbuf+chlen, enc)) {
|
||||
strcpy(err, "invalid multibyte escape");
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user