summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-10 13:07:03 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-10 13:07:03 +0000
commitf1b2fb67061ee2fa15a04e8777bcb55790a9dd5c (patch)
treec1d0cde82aec9346feb3ba2605b402177f522f04
parenteb778a7b6bfb16f4dd5f1a682ff0dc3dcb31e0f3 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--parse.y4
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a9ab4f16b..43c81b0f33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,15 @@
+Thu Mar 10 21:59:37 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* parse.y (parser_encode_length): fix typo: the length of
"-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@ruby-lang.org>
* test/ruby/test_require.rb: setting too long string to ENV causes
diff --git a/parse.y b/parse.y
index b1408d8fd8..50aafbf876 100644
--- a/parse.y
+++ b/parse.y
@@ -6233,7 +6233,9 @@ parser_encode_length(struct parser_params *parser, const char *name, long len)
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;