Actions
Bug #11679
closedPartial name of coding is allowed at magic comment
Bug #11679: Partial name of coding is allowed at magic comment
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-11-12 trunk 52549)
Description
Encoding of magic comment is allowed by just c: ....
Is this expected result or not?
$ cat test.rb # -*- c: foo -*- $ ./miniruby -v test.rb ruby 2.3.0dev (2015-11-12 trunk 52549) [x86_64-linux] test.rb:1: unknown encoding name: foo (ArgumentError) $ cat test.rb # c: foo $ ./miniruby -v test.rb ruby 2.3.0dev (2015-11-12 trunk 52549) [x86_64-linux] test.rb:1: unknown encoding name: foo (ArgumentError) # c: foo behavior is changed by r52208.
This is same as frozen-string-literal.
$ cat testf.rb # f: true p 'foo'.frozen? $ ./miniruby testf.rb true I attached a patch not to allow partial name.
Files
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
- Status changed from Open to Closed
Applied in changeset r52550.
parse.y: exact magic comment name
- parse.y (parser_magic_comment): should match exactly.
[ruby-core:71460] [Bug #11679]
Actions