diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 06:22:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-17 06:22:58 +0000 |
commit | 656c0c4302a7595845ac76a14ff39b83186e95ff (patch) | |
tree | dbe810f986a5dfd4b0ce5335b3cdb71f5edbbfe9 /sample/test.rb | |
parent | 6d66fcab264406bc9d5aef7f0cd3e1467969008f (diff) | |
download | ruby-656c0c4302a7595845ac76a14ff39b83186e95ff.tar.gz ruby-656c0c4302a7595845ac76a14ff39b83186e95ff.tar.xz ruby-656c0c4302a7595845ac76a14ff39b83186e95ff.zip |
* sample/test.rb (valid_syntax?): should not capture BOM.
* test/ruby/test_system.rb (TestSystem#valid_syntax?): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r-- | sample/test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb index b1560d310..f3ac9c4a4 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1931,7 +1931,7 @@ end def valid_syntax?(code, fname) p fname code = code.dup.force_encoding("ascii-8bit") - code.sub!(/\A(\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { + code.sub!(/\A(?:\xef\xbb\xbf)?(\s*\#.*$)*(\n)?/n) { "#$&#{"\n" if $1 && !$2}BEGIN{throw tag, :ok}\n" } code.force_encoding("us-ascii") |