Andres Mejia [Sat, 4 Feb 2012 02:14:21 +0000 (21:14 -0500)]
Use syntax highlighting markup from Github's gollum to add code blocks.
Fixes issue using <pre> tags for github wiki pages. See
https://github.com/github/gollum, section 'SYNTAX HIGHLIGHTING' for info on
using this markup.
Andres Mejia [Thu, 2 Feb 2012 20:03:06 +0000 (15:03 -0500)]
Add LIBRARY section in archive_entry manpage.
This doesn't use .Lb, since the libarchive description needed by groff, i.e.
".ds str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive)"
would not be found on all systems by default.
Additional tests that for a combination of both archive_matching_newer_mtime_than
and archive_matching_older_mtime_than, and also a combination of both
archive_matching_newer_ctime_than and archive_matching_older_ctime_than.
Speed up test_archive_matching_time by stopping making reference files for each
tests, wich take time to make sure those files have different ctime. And
make common reference files instead.
Remove both MBS and WCS interfaces of archive_matching_pathname_newer_mtime.
I think them will not be used since archive_matching_pathname_newer_mtime is used for
matching entries that are already in an archive file being updated.
And rename archive_matching_pathname_newer_mtime_ae to archive_matching_pathname_newer_mtime.
Tim Kientzle [Tue, 24 Jan 2012 06:05:46 +0000 (01:05 -0500)]
Issue 226: Fix infinite loop when a data descriptor marking
the end of an uncompressed entry falls exactly at the end of
a block and the seeking Zip reader tries to skip it.
To test this, the test_compat_zip_7 test reads a small sample
XPS file with every block size from 1 byte up to 1000 bytes.
(For this specific bug, an 807-byte block triggers the
problem.)
Sort entries in the central directory of a Zip archive by its local header offset
in order to reduce file seeking(calling __archive_read_seek) for read performance.
Tim Kientzle [Tue, 24 Jan 2012 05:23:53 +0000 (00:23 -0500)]
Issue 225: The seeking Zip reader should fall back on
the filename to determine whether the current file
is a directory if there is not a POSIX mode value stored.
When ENOMEM happened in archive_string_append_from_wcs and archive_string_append_from_mbs,
those function should report the error to the caller instead of invoking __archive_errx().
We should report that ENOMEM error as possible as we can and we still need to further
improve reporting ENOEM.
Tim Kientzle [Mon, 23 Jan 2012 03:21:30 +0000 (22:21 -0500)]
Issue 225: Misreading directories in MSDOS Zip files.
These files don't put a POSIX "mode" value in the "external
attributes" field. We used to always assume a regular file if we
didn't see that.
Now, the code leaves the mode set to zero in that case. When we read
the local file header, the fallback heuristics will kick in and
examine the filename to determine whether this is a directory
or a regular file.
Issue 224:Mishandling CD9660 images with RockRidge extensions from FreeBSD makefs.
A file size of the symblic link file in ISO images made by makefs is not zero and
its location is not negative. That makes ISO reader misleading that that file is
a hard like file.
We have to check if the file type is symbolic like or not, if so and its file size
is not zero, reset the file size to zero and also reset the location to -1.
Delete archive_matching_path_excluded and archive_matching_path_excluded_w.
They were not so helpful than I though at archive_read_disk.
Rename archive_matching_path_excluded_ae to archive_matching_path_excluded.
Rename archive_matching_time_excluded_ae to archive_matching_time_excluded.
Rename archive_matching_owner_excluded_ae to archive_matching_owner_excluded.
Rename archive_matching_excluded_ae to archive_matching_excluded.
Cast away archive_read_disk_set_name_filter_callback and add archive_read_disk_set_matching instead
to effectively call archive_matching_*_excluded_ae function in archive_read_disk.
Use archive_matching API at both bsdcpio and bsdtar instead of lafe_exclude functions.
- Remove libarchive_fe/matching.[ch], which are no longer needed.
- Move cpio/test/test_pathmatch.c into libarchive/test/test_archive_pathmatch.c.
Introduce archive_matching APIs. This is a set of utility functions to
find matched archive_entry objects. This is based on libarchive_fe/matching.[ch]
I added serveral interfaces for wchar_t, and matching file stamps and owners.
I also plan to use that at archive_read_disk instead of
archive_read_disk_set_name_filter_callback function, which I recently added.
Tim Kientzle [Thu, 12 Jan 2012 06:20:17 +0000 (01:20 -0500)]
Remove the unused system types from the public headers. We stripped
out almost all of the system-specific ino_t, uid_t, gid_t, etc, types
from the libarchive public API, so these definitions are no longer
needed.
In practice, those types are broken on enough systems that it just
wasn't worth trying to use them.
Brad King [Wed, 11 Jan 2012 13:15:53 +0000 (08:15 -0500)]
Define _XOPEN_SOURCE=500 on HP-UX
The HP-UX <wchar.h> header provides 'mbstate_t' in C89/C90 mode only if
_XOPEN_SOURCE is defined to exactly 500. Type 'mbstate_t' was
introduced in C89/C90 Normative Amendment 1, aka C94/C95, adding support
international character sets. It is part of C99 but not C89/C90.
Brad King [Wed, 11 Jan 2012 13:15:42 +0000 (08:15 -0500)]
Check for 'struct statvfs' member 'f_iosize'
Configure the result as definition HAVE_STRUCT_STATVFS_F_IOSIZE and use
the member only if it exists. At least one platform (IRIX) provides
struct statvfs without this member.
Brad King [Wed, 11 Jan 2012 13:15:25 +0000 (08:15 -0500)]
Fix Windows NT API usage in VS 6
VS 6 warns verbosely when WINVER >= 0x0500. Avoid defining WINVER and
_WIN32_WINNT to higher than 0x0400 on VS 6. Provide missing API
declarations in archive_windows.h when we do not get them from
<windows.h>. Provide GetVolumePathNameW because VS 6 does not declare
it regardless of the API version.
Brad King [Wed, 11 Jan 2012 13:15:20 +0000 (08:15 -0500)]
Cast mode constants to mode_t in case it is signed
At least one compiler (Borland) defines mode_t as just "short" which is
signed. This breaks code like
switch(archive_entry_filetype(e)) {
case AE_IFREG:
...
}
if AE_IFREG and other constants have a longer signed type (int) because
sign extension of the mode_t return type from archive_entry_filetype
changes its value. Avoid the problem by ensuring the type of the
constants matches mode_t.
Brad King [Wed, 11 Jan 2012 13:15:09 +0000 (08:15 -0500)]
Declare mbstate_t and wcrtomb for Borland
The Borland C++ 5.81 runtime library provides wcrtomb but only the C++
header <cwchar> actually declares the API. Since this is C code we
cannot use the header, so declare it ourselves.
Brad King [Wed, 11 Jan 2012 13:15:03 +0000 (08:15 -0500)]
Implement custom lseek for Borland
Restore Windows 64-bit lseek removed by upstream svn revision 3826
(Cast away __la_lseek(), use _lseeki64() instead, 2011-11-21). We
need it on Borland.