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

ruby-changes:19048

From: naruse <ko1@a...>
Date: Thu, 10 Mar 2011 22:07:12 +0900 (JST)
Subject: [ruby-changes:19048] Ruby:r31086 (trunk): * parse.y (parser_encode_length): add exception as UTF8-MAC for

naruse	2011-03-10 22:07:03 +0900 (Thu, 10 Mar 2011)

  New Revision: 31086

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

  Log:
    * parse.y (parser_encode_length): add exception as UTF8-MAC for
      magic comment's emacs newline specifier
      patched by James M. Lawrence [ruby-core:35476] fixes #4489

  Modified files:
    trunk/ChangeLog
    trunk/parse.y

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31085)
+++ ChangeLog	(revision 31086)
@@ -1,3 +1,9 @@
+Thu Mar 10 21:59:37 2011  NARUSE, Yui  <naruse@r...>
+
+	* parse.y (parser_encode_length): add exception as UTF8-MAC for
+	  magic comment's emacs newline specifier
+	  patched by James M. Lawrence [ruby-core:35476] fixes #4489
+
 Thu Mar 10 16:00:22 2011  NARUSE, Yui  <naruse@r...>
 
 	* parse.y (parser_encode_length): fix typo: the length of
@@ -3,4 +9,5 @@
 	  "-dos" and "-mac" is not 5 but 4.
 	  patched by James M. Lawrence [ruby-core:35476] fixes #4489
+
 Thu Mar 10 10:52:01 2011  NAKAMURA Usaku  <usa@r...>
 
Index: parse.y
===================================================================
--- parse.y	(revision 31085)
+++ parse.y	(revision 31086)
@@ -6233,7 +6233,9 @@
     if (len > 4 && name[nlen = len - 4] == '-') {
 	if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0)
 	    return nlen;
-	if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0)
+	if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 &&
+	    !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0))
+	    /* exclude UTF8-MAC because the encoding named "UTF8" doesn't exist in Ruby */
 	    return nlen;
     }
     return len;

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

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