Commit Graph

13 Commits

Author SHA1 Message Date
Rummskartoffel
4aaab80649 unzip: Don't fail from mmap when trying to decompress empty files
Given an empty file, unzip would try to create a zero-size memory
mapping of that file, which would fail with EINVAL. With this commit,
attempting to unzip an empty file of course still fails, since that's
not a valid PKZIP file, but it now fails for the correct reason and with
the correct error message.
2022-01-15 22:24:19 +02:00
mjz19910
1f1383fe1e unzip: Remove useless .characters() calls 2022-01-04 23:53:46 -08:00
mjz19910
154d33f240 unzip: Port to LibMain 2022-01-04 10:59:42 +00:00
Andreas Kling
58fb3ebf66 LibCore+AK: Move MappedFile from AK to LibCore
MappedFile is strictly a userspace thing, so it doesn't belong in AK
(which is supposed to be user/kernel agnostic.)
2021-11-23 11:33:36 +01:00
Jelle Raaijmakers
3fa5b27931 Utilites: Implement unzip -q 2021-06-13 17:05:48 +01:00
Jelle Raaijmakers
c247d7a662 Utilities: Change unzip -o option to -d
Other `unzip` implementations universally use `-d` to indicate the
output directory, so let's follow this convention.
2021-06-13 17:05:48 +01:00
Jean-Baptiste Boric
3038edab00 Utilities: Correct non-standard assert macros includes 2021-05-17 18:14:05 +01:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
TheGeopard
6a4ea4bf55 unzip: Add output directory option
This allows setting the output directory for unzip by adding a new
optional argument
2021-04-25 18:40:42 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Idan Horowitz
8eceef0b1b unzip: Use the new LibArchive Zip parser
This parser should be a little bit more modern and a little more
resilient to zip files from other operating systems. As a side
effect we now also support extracting zip files that are using
DEFLATE compression (using our own LibCompress).
2021-03-23 16:09:36 +01:00
Andreas Kling
5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00