reopen 798766 thanks Hi,
On Mon, Sep 14, 2015 at 10:41:38PM +0200, ZenWalker wrote: > ok, [ and ] are special characters > > I have two files: > > testing1.tar with a file named te[sting > > testing2.tar with a file named te]sting > > -------------------------------- > > unar testing1.tar te[sting > testing1.tar: : Uncaught exception XADRegexException, reason: Could not > compile regex "^te[sting$": [ รณ ^[ desemparejados > > ------------------------------------ > > unar testing2.tar te]sting > testing2.tar: Tar > te]sting (8 B)... OK. > Successfully extracted to "./te]sting". > > --------------------------------------- > > why with ] unar works perfectly ? > > why [ fails ? > > I think this is a bug > > With the patch, [ and ] works and successfully ectracted. Yes, your patch does fix those cases. Unfortunately, it makes patterns which contain [...] to control which files to extract no longer work. For example, when I use the attached tar file and run unar [ab] unar extracts both a and b. When I use unar with your patch applied, since the [ is escaped, it no longer extracts anything. I think the [ should be escaped only if there is no matching ]. This also won't fix the bugs in engrampa and file-roller, since they will still fail to extract files with names like "te[st]ing". The correct way to handle this is for these programs to escape the special pattern characters. -- Matt https://ftbfs.org/~kraai/
foo.tar
Description: Unix tar archive