TwP / inifile

Native Ruby package for reading and writing INI files
http://codeforpeople.rubyforge.org/inifile
95 stars 47 forks source link

RegexpError on empty comment string #18

Closed ghost closed 10 years ago

ghost commented 11 years ago

I want to completely disable comment parsing, but I get a RegexpError when trying to pass the empty string for the :comment option:

irb(main):004:0> a=IniFile::load("test.ini", :comment=>"")
RegexpError: empty char-class: /\A\s*(?:[].*)?$/
    from /home/foo/inifile/lib/inifile.rb:431:in `parse!'
    from /home/foo/inifile/lib/inifile.rb:148:in `read'
    from /home/foo/inifile/lib/inifile.rb:91:in `initialize'
    from /home/foo/inifile/lib/inifile.rb:35:in `new'
    from /home/foo/inifile/lib/inifile.rb:35:in `load'
    from (irb):4
    from /usr/bin/irb:12:in `<main>'