Skip to content

Commit

Permalink
Escaping extension to avoid regexp error
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon COURTOIS committed Feb 23, 2012
1 parent a2f5ecc commit cea5f18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/absolute_renamer/file_info.rb
Expand Up @@ -25,7 +25,7 @@ def initialize(path)
@name = File.basename(@real_path)
unless @dir
@ext = File.extname(@name, conf[:options][:dots])
@name.gsub!(Regexp.new('.' << @ext << '$'), '') unless @ext.empty?
@name.gsub!(Regexp.new('.' << Regexp.escape(@ext) << '$'), '') unless @ext.empty?
@level = 0
else
@level = @real_path.split('/').size
Expand Down

0 comments on commit cea5f18

Please sign in to comment.