[前][次][番号順一覧][スレッド一覧]

ruby-changes:40469

From: nobu <ko1@a...>
Date: Thu, 12 Nov 2015 18:44:45 +0900 (JST)
Subject: [ruby-changes:40469] nobu:r52550 (trunk): parse.y: exact magic comment name

nobu	2015-11-12 18:44:29 +0900 (Thu, 12 Nov 2015)

  New Revision: 52550

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52550

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

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52549)
+++ ChangeLog	(revision 52550)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Nov 12 18:44:26 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (parser_magic_comment): should match exactly.
+	  [ruby-core:71460] [Bug #11679]
+
 Thu Nov 12 16:16:20 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* template/prelude.c.tmpl: enable tail call optimization.
Index: parse.y
===================================================================
--- parse.y	(revision 52549)
+++ parse.y	(revision 52550)
@@ -7088,7 +7088,7 @@ parser_magic_comment(struct parser_param https://github.com/ruby/ruby/blob/trunk/parse.y#L7088
 	    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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]