GNOME Bugzilla – Bug 559481
Can't open/view file directly from File Roller if there is a bracket in the directory/file name
Last modified: 2008-12-31 11:16:36 UTC
this bug has been filed here: https://bugs.edge.launchpad.net/ubuntu/+source/file-roller/+bug/294215 "Try open the ZIP file attached with File Roller (AKA Archive Manager). In my case I can't open/view directly if there is square brackets on the directory/file name. It gives me error message like this: > caution: filename not matched: aaa[aaa].txt There is no problem when extracting the entire file's content though. I have the same file but in RAR and there is no problem at all." file to test: http://launchpadlibrarian.net/19392225/file-roller-zip-bug.zip
Same here. An error occurred while extracting files. (null) caution: filename not matched: Super Metroid (JU) [!].smc 1 archive had fatal errors.
It seems that file-roller sends the matching filename unmodified to unzip. However, unzip allows for wildcards in the matching name and as such applies special meaning to the characters "[]*?!^-\". The special meaning for these characters can be suppressed by preceding each of these special characters with the '\' (backslash) character. This probably requires special processing of the file_list parameter in e.g. fr_command_zip_extract (requires a special zip-purpose 'fr_process_add_arg' that correctly escapes the special characters in the argument before calling fr_process_add_arg?). For more information on the special characters, see comment from unzip "match.c" file: `*' matches any sequence of characters (zero or more) `?' matches any single character [SET] matches any character in the specified set, [!SET] or [^SET] matches any character not in the specified set. A set is composed of characters or ranges; a range looks like ``character hyphen character'' (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of characters allowed in the [..] pattern construct. Other characters are allowed (i.e., 8-bit characters) if your system will support them. To suppress the special syntactic significance of any of ``[]*?!^-\'', in- side or outside a [..] construct, and match the character exactly, precede it with a ``\'' (backslash). Note that "*.*" and "*." are treated specially under MS-DOS if DOSWILD is defined. See the DOSWILD section below for an explanation. Note also that with VMSWILD defined, '%' is used instead of '?', and sets (ranges) are delimited by () instead of [].
Created attachment 125067 [details] [review] Patch for zip extract file and delete file wildcard bug
Note that the attached patch assumes file-roller interfaces with Info-ZIP's zip and unzip (I used Ubuntu 8.10). I think this might not always be the case for all platforms, or even for all linux ditributions. So the patch might need some additional work to be sure it still works on all platforms/distributions.
this problem only occurs with the zip/unzip utilities, if you install 7zip file-roller will use 7zip to open zip files and the problem doesn't occur anymore. 7zip is the file-roller preferred utility to handle zip files.
patch applied to current trunk, thanks.
*** Bug 566066 has been marked as a duplicate of this bug. ***