summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-12 09:44:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-12 09:44:29 +0000
commitd674e6dfec7f54a66235f5bfa8e4597b766797b8 (patch)
tree30e30aa27eed07ef66b94aa29d105d92e0b79362
parent2c42aac9fbe91f7d3287797d3c91181d90c884d1 (diff)
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
-rw-r--r--ChangeLog5
-rw-r--r--parse.y2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fdb9980..e540a87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/parse.y b/parse.y
index 56e4243..8b26b83 100644
--- a/parse.y
+++ b/parse.y
@@ -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);