clip9 / adbren

adbren - Rename and organize anime using this AniDB API client written in perl
39 stars 10 forks source link

fix: Stop filenames which are not valid regular expressions crashing #19

Closed twpol closed 4 years ago

twpol commented 4 years ago

When you generate a filename that contains square brackets, and a hyphen within that, the skip checking code can subsequently crash if the characters either side of the hyphen do not form a valid range.

For example, "[i-S]" in a filename will crash.

Given that this check is meant to be searching for existing items, not actually applying a regular expression, I've used quotemeta on the whole filename.

thoj commented 4 years ago

Very nice solution. Thank you.