parse.y: exact magic comment name

* parse.y (parser_magic_comment): should match exactly.
  [ruby-core:71460] [Bug #11679]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-11-12 09:44:29 +00:00
parent 2c42aac9fb
commit d674e6dfec
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Thu Nov 12 18:44:26 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parser_magic_comment): should match exactly.
[ruby-core:71460] [Bug #11679]
Thu Nov 12 16:16:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* template/prelude.c.tmpl: enable tail call optimization.

View File

@ -7088,7 +7088,7 @@ parser_magic_comment(struct parser_params *parser, const char *str, long len)
if (s[i] == '-') s[i] = '_';
}
do {
if (STRNCASECMP(p->name, s, n) == 0) {
if (STRNCASECMP(p->name, s, n) == 0 && !p->name[n]) {
n = vend - vbeg;
if (p->length) {
n = (*p->length)(parser, vbeg, n);