Best I can tell, the only reliable way to determine that an archive doesn't require a password is to attempt to extract it without a password. Unfortunately, for zip files, when you pass a -p argument, there is nothing in the output to indicate whether it was actually used or not.
To take advantage of this, I modified PW_LIST to be a list whose first element is an empty string. This causes 7z to attempt extraction with an empty password (i.e. no password) first. The success/failure of this extraction will show if this archive requires a password to extract or not.
Fixes #133.
Best I can tell, the only reliable way to determine that an archive doesn't require a password is to attempt to extract it without a password. Unfortunately, for zip files, when you pass a
-p
argument, there is nothing in the output to indicate whether it was actually used or not.To take advantage of this, I modified
PW_LIST
to be a list whose first element is an empty string. This causes7z
to attempt extraction with an empty password (i.e. no password) first. The success/failure of this extraction will show if this archive requires a password to extract or not.