MacPaw/XADMaster

"Uncaught exception XADRegexException" when extracting a file with brackets in name

Opened this issue · 1 comments

Version: 1.10.1

When archive contains a file with name like [].txt or [.txt and unar is invoked like this:
unar brackets.zip "brackets/[].txt"
or
unar brackets.zip "brackets/[.txt"

The error message is:
Uncaught exception XADRegexException, reason: Could not compile regex "^brackets/[]\.txt$": Unmatched [, [^, [:, [., or [=

A name with only a closing bracket e.g. ].txt seems to be OK:
unar brackets.zip "brackets/].txt"

Example archive:
brackets.zip

Thanks.

Also when the name is like [text].txt there is no exception but the file is not extracted and unar returns exit code 0.

user@host:~/test$ unar brackets.zip "brackets/[text].txt"
brackets.zip: Zip
No files extracted.
user@host:~/test$ echo $?
0

With name [text.txt:

user@host:~/test$ unar brackets.zip "brackets/[text.txt"
brackets.zip: : Uncaught exception XADRegexException, reason: Could not compile regex "^brackets/[text\.txt$": Unmatched [, [^, [:, [., or [=

With name text].txt everything is OK.

Updated archive:
brackets.zip