]> git.ipfire.org Git - thirdparty/libarchive.git/log
thirdparty/libarchive.git
15 years agoAvoid a extra conversion of file times in restoring file times on Windows.
Michihiro NAKAJIMA [Sat, 16 Apr 2011 06:24:13 +0000 (02:24 -0400)] 
Avoid a extra conversion of file times in restoring file times on Windows.

SVN-Revision: 3246

15 years agoTweak a test of cpio date format for Windows.
Michihiro NAKAJIMA [Sat, 16 Apr 2011 06:05:50 +0000 (02:05 -0400)] 
Tweak a test of cpio date format for Windows.

SVN-Revision: 3245

15 years agoUse Widows file handle 'HANDLE' directly in archive_read_disk_windows.c instead of...
Michihiro NAKAJIMA [Sat, 16 Apr 2011 05:27:28 +0000 (01:27 -0400)] 
Use Widows file handle 'HANDLE' directly in archive_read_disk_windows.c instead of POSIX file descriptor.

SVN-Revision: 3244

15 years agoRemove unneeded condition code.
Michihiro NAKAJIMA [Sat, 16 Apr 2011 04:18:25 +0000 (00:18 -0400)] 
Remove unneeded condition code.

SVN-Revision: 3243

15 years agoMove variables only used in directory traversals from struct archive_read_disk to...
Michihiro NAKAJIMA [Sat, 16 Apr 2011 04:08:29 +0000 (00:08 -0400)] 
Move variables only used in directory traversals from struct archive_read_disk to struct tree.

SVN-Revision: 3242

15 years agoFix build error on POSIX platform.
Michihiro NAKAJIMA [Sat, 16 Apr 2011 03:43:08 +0000 (23:43 -0400)] 
Fix build error on POSIX platform.

SVN-Revision: 3241

15 years agoAdd ENABLE_ICONV option to CMake build. At this time the ENABLE_ICONV on Windows...
Michihiro NAKAJIMA [Sat, 16 Apr 2011 02:22:34 +0000 (22:22 -0400)] 
Add ENABLE_ICONV option to CMake build. At this time the ENABLE_ICONV on Windows platform is OFF.
Tweak initial value for CMake option to correctly work on CMake GUI.

SVN-Revision: 3240

15 years agoClean up archive_string.c.
Michihiro NAKAJIMA [Sat, 16 Apr 2011 01:36:41 +0000 (21:36 -0400)] 
Clean up archive_string.c.
 - Correctly work both iconv version and Win32 API version.
 - Reduce #if directive.

SVN-Revision: 3239

15 years agoFix locale_charset detection on CMake to be worked on
Michihiro NAKAJIMA [Fri, 15 Apr 2011 14:53:12 +0000 (10:53 -0400)] 
Fix locale_charset detection on CMake to be worked on
both HAVE_POSIX_ICONV_IN_LIBICONV and HAVE_NONPOSIX_ICONV_IN_LIBICONV.

SVN-Revision: 3238

15 years agoInitialize locale on bsdcpio, and change test_option_t accordingly
Michihiro NAKAJIMA [Fri, 15 Apr 2011 14:37:42 +0000 (10:37 -0400)] 
Initialize locale on bsdcpio, and change test_option_t accordingly
because it compared date format in "C" locale to the output of bsdcpio -t option.

SVN-Revision: 3237

15 years agoImprove test_read_format_zip_filename.
Michihiro NAKAJIMA [Fri, 15 Apr 2011 11:40:33 +0000 (07:40 -0400)] 
Improve test_read_format_zip_filename.
Add the check that zip reader does not translate the filename stored in UTF-8
charset and its UTF-8 Name flag(general purpose flag bit 11) is set
whenever a hdrcharset option is specified.

SVN-Revision: 3236

15 years agoAvoid warning about iconv.h during configure.
Michihiro NAKAJIMA [Fri, 15 Apr 2011 10:53:07 +0000 (06:53 -0400)] 
Avoid warning about iconv.h during configure.

SVN-Revision: 3235

15 years agoUse locale_charset() instead of nl_langinfo(CODESET) for GNU libiconv.
Michihiro NAKAJIMA [Fri, 15 Apr 2011 09:53:13 +0000 (05:53 -0400)] 
Use locale_charset() instead of nl_langinfo(CODESET) for GNU libiconv.
The charset name which nl_langinfo(CODESET) returns is dependent on
the platform and so GNU libiconv will not recognize the charset name
on some platform. It is the same as you pass an empty name "" to iconv,
but that is GNU libiconv specific function although FreeBSD iconv allow
the empty name. I think locale_charset is better than use of "" because
It is easy to know what charset is current when debugging.

SVN-Revision: 3234

15 years agoUpdate comment and sort macros in build/cmake/config.h.in
Michihiro NAKAJIMA [Fri, 15 Apr 2011 08:05:43 +0000 (04:05 -0400)] 
Update comment and sort macros in build/cmake/config.h.in

SVN-Revision: 3233

15 years agoAddtional fix for r3231.
Michihiro NAKAJIMA [Fri, 15 Apr 2011 07:19:17 +0000 (03:19 -0400)] 
Addtional fix for r3231.
I mistook.

SVN-Revision: 3232

15 years agoFix a iconv detection of cmake.
Michihiro NAKAJIMA [Fri, 15 Apr 2011 06:24:00 +0000 (02:24 -0400)] 
Fix a iconv detection of cmake.
- Properly find optional directories such as /usr/local/{include,lib}.
- Use FIND_PATH(ICONV_INCLUDE_DIR iconv.h) instead of
  LA_CHECK_INCLUDE_FILE("iconv.h" HAVE_ICONV_H) because detecting libxml2
  headers uses ICONV_INCLUDE_DIR.

SVN-Revision: 3231

15 years agoImprove archive_string_append_from_wcs() on Windows.
Michihiro NAKAJIMA [Fri, 15 Apr 2011 03:53:56 +0000 (23:53 -0400)] 
Improve archive_string_append_from_wcs() on Windows.
Avoid a use of malloc/free and memory copy.

SVN-Revision: 3230

15 years agoAdd a hdrcharset option test for pax format.
Michihiro NAKAJIMA [Thu, 14 Apr 2011 14:24:35 +0000 (10:24 -0400)] 
Add a hdrcharset option test for pax format.
Whenever hdrcharset option is specified, we will correctly read the filename
stored in UTF-8 charset by default.
For pax format, users can specify charset to BINARY filenames only.

SVN-Revision: 3229

15 years agoAdd a hdrcharset option test for gnutar format.
Michihiro NAKAJIMA [Thu, 14 Apr 2011 12:39:16 +0000 (08:39 -0400)] 
Add a hdrcharset option test for gnutar format.

SVN-Revision: 3228

15 years agoAdd hdrcharset option support for cpio format.
Michihiro NAKAJIMA [Thu, 14 Apr 2011 10:50:43 +0000 (06:50 -0400)] 
Add hdrcharset option support for cpio format.

SVN-Revision: 3227

15 years agoDisable test_pax_filename_encoding_3(), which has been failing recently,
Michihiro NAKAJIMA [Wed, 13 Apr 2011 16:46:59 +0000 (12:46 -0400)] 
Disable test_pax_filename_encoding_3(), which has been failing recently,
until Tim check out and decide the matter.

SVN-Revision: 3226

15 years agoUnbreak build on Linux; correct second argument of futimens().
Michihiro NAKAJIMA [Wed, 13 Apr 2011 16:24:55 +0000 (12:24 -0400)] 
Unbreak build on Linux; correct second argument of futimens().

SVN-Revision: 3225

15 years agoOn Windows, this command line systemf("echo f | bsdcpio -pd copy >copy.out 2>copy...
Michihiro NAKAJIMA [Wed, 13 Apr 2011 13:54:59 +0000 (09:54 -0400)] 
On Windows, this command line systemf("echo f | bsdcpio -pd copy >copy.out 2>copy.err"),
bsdcpio will get a wrong filename "f ". this "echo f| bsdcpio ...." can correctly pass
a intended filename to bsdcpio.

SVN-Revision: 3224

15 years agor3216 was insufficient. It needs father changes.
Michihiro NAKAJIMA [Wed, 13 Apr 2011 13:43:46 +0000 (09:43 -0400)] 
r3216 was insufficient. It needs father changes.
Windows "\\.\" prefix path mechanism does not allow "../" or "./" components.
So if GetLastError() returns ERROR_INVALID_NAME we retry the operation with the corrected name
renamed through __la_win_permissive_name_w(), which returns a canonical path.

SVN-Revision: 3223

15 years agoConsider the large i-node number for the tests using cpio newc format.
Michihiro NAKAJIMA [Wed, 13 Apr 2011 10:43:55 +0000 (06:43 -0400)] 
Consider the large i-node number for the tests using cpio newc format.
Some cpio tests on Cygwin 1.7.x always failed because of the large i-node number.

SVN-Revision: 3222

15 years agoRevert path separator conversion for CYGWIN. I deleted it by mistake when removing...
Michihiro NAKAJIMA [Wed, 13 Apr 2011 04:36:14 +0000 (00:36 -0400)] 
Revert path separator conversion for CYGWIN. I deleted it by mistake when removing Windows support code.

SVN-Revision: 3221

15 years agoFix a fiex existence test for a pattern "../../fileXX".
Michihiro NAKAJIMA [Wed, 13 Apr 2011 03:48:10 +0000 (23:48 -0400)] 
Fix a fiex existence test for a pattern "../../fileXX".

SVN-Revision: 3220

15 years agoApply the default string conversion(mostly OEMCP ==> ACP) to cab reader.
Michihiro NAKAJIMA [Tue, 12 Apr 2011 15:02:35 +0000 (11:02 -0400)] 
Apply the default string conversion(mostly OEMCP ==> ACP) to cab reader.
As you know, it works for Windows platform only.

SVN-Revision: 3219

15 years agoProperly report string conversion failure.
Michihiro NAKAJIMA [Tue, 12 Apr 2011 14:19:25 +0000 (10:19 -0400)] 
Properly report string conversion failure.

SVN-Revision: 3218

15 years agoAllow to apply the charset specified by the hdrcharset option to PAX reader only...
Michihiro NAKAJIMA [Tue, 12 Apr 2011 13:32:57 +0000 (09:32 -0400)] 
Allow to apply the charset specified by the hdrcharset option to PAX reader only when
the the charset described in PAX attribute is BINARY because BINARY means
the the character-set of a bunch of metadata(filname/uname/gname) is unknown.
It might be useful users can specify charset for 'BINARY' metadata, the users
may know a proper charset or try to find what kind of charset correctly convert.

SVN-Revision: 3217

15 years agoFix the problem about full-pathnames handling with the path multiple dirs in one...
Michihiro NAKAJIMA [Tue, 12 Apr 2011 08:39:09 +0000 (04:39 -0400)] 
Fix the problem about full-pathnames handling with the path multiple dirs in one entry.

SVN-Revision: 3216

15 years agoClearly archive_write_disk object on Windows cannot handle Mac MetaData.
Michihiro NAKAJIMA [Tue, 12 Apr 2011 03:50:31 +0000 (23:50 -0400)] 
Clearly archive_write_disk object on Windows cannot handle Mac MetaData.

SVN-Revision: 3215

15 years agoIn archive_write_disk_windows.c, Use the Windows file handle 'HANDLE' instead of...
Michihiro NAKAJIMA [Tue, 12 Apr 2011 03:39:48 +0000 (23:39 -0400)] 
In archive_write_disk_windows.c, Use the Windows file handle 'HANDLE' instead of the POSIX file descriptor.

SVN-Revision: 3214

15 years agoImprove archive_write_disk_windows.c.
Michihiro NAKAJIMA [Mon, 11 Apr 2011 16:46:37 +0000 (12:46 -0400)] 
Improve archive_write_disk_windows.c.
 - Use WCS to pathname. This has made following changes.
 - FindFirstFileW and GetFileInformationByHandle instead of stat/lstat.
 - Move __la_chmod and __la_ftruncate used only in the file from archive_windows.c
   and change it to wide char version.
 - Remove __la_mkdir and directly use CreateDirectoryW in the file.
 - Remove  __la_rmdir and use _wrmdir in the file.
 - Remove __la_unlink and use _wunlink in the file.
 - Remove __la_link and Move la_CreateHardLinkW into the file to use it directly.
 - Use _wopen instead of __la_open.

Unfortunately, at this time we cannot use full-pathname through __la_win_permissive_name_w()
completely at the file because __la_win_permissive_name_w() trim "../". For example, the path
"abc/a/../b../c", which is multi dirs in one entry, will be converted to "<parent-dir>/abc/c",
so we could not make both abc/a and abc/b directories if we applied __la_win_permissive_name_w()
to the path at _archive_write_disk_header().

SVN-Revision: 3213

15 years agoRemove non Windows platform code from archive_write_disk_windows.c
Michihiro NAKAJIMA [Mon, 11 Apr 2011 10:15:14 +0000 (06:15 -0400)] 
Remove non Windows platform code from archive_write_disk_windows.c

SVN-Revision: 3212

15 years agoRemove Windows platform code from archive_write_disk_posix.c
Michihiro NAKAJIMA [Mon, 11 Apr 2011 09:35:51 +0000 (05:35 -0400)] 
Remove Windows platform code from archive_write_disk_posix.c

SVN-Revision: 3211

15 years agoMake two version of archive_write_disk.c by copying and renaming it;
Michihiro NAKAJIMA [Mon, 11 Apr 2011 09:23:29 +0000 (05:23 -0400)] 
Make two version of archive_write_disk.c by copying and renaming it;
one is for POSIX platform, other one is for Windows platform.
The Windows version will be cleaned up and some part of it will be
reimplemented by Win32 API for reducing the overhead simulates POSIX API.

SVN-Revision: 3210

15 years agoDo not compile archive_read_disk_windows.c on POSIX platform.
Michihiro NAKAJIMA [Mon, 11 Apr 2011 05:15:25 +0000 (01:15 -0400)] 
Do not compile archive_read_disk_windows.c on POSIX platform.

SVN-Revision: 3209

15 years agoAdd a wide character version of archive_entry_sourcepath() and archive_entry_copy_sou...
Michihiro NAKAJIMA [Mon, 11 Apr 2011 05:05:52 +0000 (01:05 -0400)] 
Add a wide character version of archive_entry_sourcepath() and archive_entry_copy_sourcepath().

SVN-Revision: 3208

15 years agoRename archive_string_append_from_wcs_to_mbs function to archive_string_append_from_wcs.
Michihiro NAKAJIMA [Mon, 11 Apr 2011 04:30:34 +0000 (00:30 -0400)] 
Rename archive_string_append_from_wcs_to_mbs function to archive_string_append_from_wcs.

SVN-Revision: 3207

15 years agoRemove first argument of archive_wstring_append_from_mbs/archive_string_append_from_w...
Michihiro NAKAJIMA [Mon, 11 Apr 2011 04:25:41 +0000 (00:25 -0400)] 
Remove first argument of archive_wstring_append_from_mbs/archive_string_append_from_wcs_to_mbs.
It is no longer needed for WCS<==>MBS conversion.

SVN-Revision: 3206

15 years agoCorrectly convert charset names, both "CP_ACP" and "CP_OEMCP", to current ACP and...
Michihiro NAKAJIMA [Mon, 11 Apr 2011 04:03:09 +0000 (00:03 -0400)] 
Correctly convert charset names, both "CP_ACP" and "CP_OEMCP", to current ACP and OEMCP.

SVN-Revision: 3205

15 years agoReduce a string buffer copy in the wctomb/wcrtomb version of
Michihiro NAKAJIMA [Mon, 11 Apr 2011 03:38:46 +0000 (23:38 -0400)] 
Reduce a string buffer copy in the wctomb/wcrtomb version of
archive_string_append_from_wcs_to_mbs().

SVN-Revision: 3204

15 years agoUse wcsnrtombs() at archive_string_append_from_wcs_to_mbs() if available.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 15:57:06 +0000 (11:57 -0400)] 
Use wcsnrtombs() at archive_string_append_from_wcs_to_mbs() if available.
It's faster than use of wcrtomb/wctomb.

SVN-Revision: 3203

15 years agoAdd and update comments in archive_string.c.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 14:27:46 +0000 (10:27 -0400)] 
Add and update comments in archive_string.c.

SVN-Revision: 3202

15 years agoAdd some CP932 filename tests.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 13:48:22 +0000 (09:48 -0400)] 
Add some CP932 filename tests.

SVN-Revision: 3201

15 years agoAdd a filename encoding test for ustar.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 13:09:30 +0000 (09:09 -0400)] 
Add a filename encoding test for ustar.

SVN-Revision: 3200

15 years agoAdd a test storing a CP1251 filename in zip file on non Windows Platform.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 12:53:43 +0000 (08:53 -0400)] 
Add a test storing a CP1251 filename in zip file on non Windows Platform.

SVN-Revision: 3199

15 years agoAdd a filename encoding test for gnutar.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 12:22:05 +0000 (08:22 -0400)] 
Add a filename encoding test for gnutar.

SVN-Revision: 3198

15 years agoAdd locale CP1251 and CP932 tests to test_pax_filename_encoding.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 11:17:54 +0000 (07:17 -0400)] 
Add locale CP1251 and CP932 tests to test_pax_filename_encoding.

SVN-Revision: 3197

15 years agotorture test archive_read_support_format_XXX as well
Roman Neuhauser [Sun, 10 Apr 2011 09:13:52 +0000 (05:13 -0400)] 
torture test archive_read_support_format_XXX as well

SVN-Revision: 3196

15 years agoplug crashes in archive_read_support_filter_XXX
Roman Neuhauser [Sun, 10 Apr 2011 09:13:35 +0000 (05:13 -0400)] 
plug crashes in archive_read_support_filter_XXX

these functions lacked protection by archive_check_magic.

SVN-Revision: 3195

15 years agoSimplify a check of de_DE.UTF-8 locale in libarchive test suite on Windows.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 07:49:18 +0000 (03:49 -0400)] 
Simplify a check of de_DE.UTF-8 locale in libarchive test suite on Windows.

SVN-Revision: 3194

15 years agoImprove test_read_format_zip_filename for Windows platform.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 07:21:45 +0000 (03:21 -0400)] 
Improve test_read_format_zip_filename for Windows platform.
 - some tests work on both POSIX and Windows platform.
 - add test_read_format_zip_filename_CP866_CP1251_win to check the automatic filename translation.

SVN-Revision: 3193

15 years agoFix the automatic filename translation on Windows and add a test for it.
Michihiro NAKAJIMA [Sun, 10 Apr 2011 07:16:21 +0000 (03:16 -0400)] 
Fix the automatic filename translation on Windows and add a test for it.

When reading CP866 filenames in the zip file on Russian Windows platform,
which its ACP is not equal to its OEMCP, We should automatically translate
CP866(OEMCP of Russian) filenames to CP1251(ACP of Russian) filenames because
other archiver application on Windows have stored the filenames in CP866
through WideCharToMultiByte() with CP_OEMCP.

SVN-Revision: 3192

15 years agoremove stuff covered by #if ARCHIVE_VERSION_NUMBER < 3000000
Roman Neuhauser [Sat, 9 Apr 2011 08:07:11 +0000 (04:07 -0400)] 
remove stuff covered by #if ARCHIVE_VERSION_NUMBER < 3000000

archive.h says #define ARCHIVE_VERSION_NUMBER 3000000, and it's
not going to decrease.

SVN-Revision: 3191

15 years agotest.h: leave __LIBARCHIVE_TEST up to individual test files
Roman Neuhauser [Sat, 9 Apr 2011 08:07:04 +0000 (04:07 -0400)] 
test.h: leave __LIBARCHIVE_TEST up to individual test files

per Tim's request, tests should be very explicit about using
libarchive's internals.

SVN-Revision: 3190

15 years agotest_archive_string.c: drop assertEqualArchiveString
Roman Neuhauser [Sat, 9 Apr 2011 08:06:57 +0000 (04:06 -0400)] 
test_archive_string.c: drop assertEqualArchiveString

the interesting bit about the archive_string* returning functions
is the returned address (these must return their first argument),
the value pointed at is tested separately.

SVN-Revision: 3189

15 years agoAdd a filename encoding test for zip.
Michihiro NAKAJIMA [Sat, 9 Apr 2011 06:52:32 +0000 (02:52 -0400)] 
Add a filename encoding test for zip.

SVN-Revision: 3188

15 years agoChoose the charset described in the archive file when it's available even if hdrchars...
Michihiro NAKAJIMA [Sat, 9 Apr 2011 04:10:02 +0000 (00:10 -0400)] 
Choose the charset described in the archive file when it's available even if hdrcharset option is used.

SVN-Revision: 3187

15 years agoCorrectly get the OEM CodePage(OEMCP) of the current locale set by setlocale().
Michihiro NAKAJIMA [Sat, 9 Apr 2011 03:23:24 +0000 (23:23 -0400)] 
Correctly get the OEM CodePage(OEMCP) of the current locale set by setlocale().
GetOEMCP() returns system default OEMCP not current locale's.

SVN-Revision: 3186

15 years agoUse of mbrtowc/wcrtomb is slower than use of WideCharToMultiByte/MultiByteToWideChar.
Michihiro NAKAJIMA [Fri, 8 Apr 2011 14:53:15 +0000 (10:53 -0400)] 
Use of mbrtowc/wcrtomb is slower than use of WideCharToMultiByte/MultiByteToWideChar.
So we should use WideCharToMultiByte/MultiByteToWideChar and
simulate CRT mbrtowc/wcrtomb handling in "C" locale.

SVN-Revision: 3185

15 years agoPax format uses only both BINARY and UTF-8 to its header data.
Michihiro NAKAJIMA [Fri, 8 Apr 2011 14:41:17 +0000 (10:41 -0400)] 
Pax format uses only both BINARY and UTF-8 to its header data.
So we should not overwrite it by the hdrcharset option.

SVN-Revision: 3184

15 years agoFollowing tests are now for all platform not only Windows.
Michihiro NAKAJIMA [Fri, 8 Apr 2011 11:58:02 +0000 (07:58 -0400)] 
Following tests are now for all platform not only Windows.
  test_read_format_zip_filename_CP932_CP932
  test_read_format_zip_filename_UTF8_CP932
  test_read_format_zip_filename_CP866_CP1251
  test_read_format_zip_filename_KOI8R_CP1251
  test_read_format_zip_filename_UTF8_CP1251

SVN-Revision: 3183

15 years agoSimplify sparse test code.
Michihiro NAKAJIMA [Fri, 8 Apr 2011 09:44:52 +0000 (05:44 -0400)] 
Simplify sparse test code.
Avoid the effect of current locale state to the current working directory in multi-byte name
for the directory traversals on Windows.

SVN-Revision: 3182

15 years agoUse of archive_strcat() in archive_string_append_from_wcs_to_mbs() is slightly ineffi...
Michihiro NAKAJIMA [Fri, 8 Apr 2011 08:59:20 +0000 (04:59 -0400)] 
Use of archive_strcat() in archive_string_append_from_wcs_to_mbs() is slightly inefficient.
We can trust a contents of buffer, so we should use archive_string_append() instead.

SVN-Revision: 3181

15 years agoOn Windows Correctly handle a directory file at archive_read_disk_entry_from_file().
Michihiro NAKAJIMA [Fri, 8 Apr 2011 08:23:15 +0000 (04:23 -0400)] 
On Windows Correctly handle a directory file at archive_read_disk_entry_from_file().

SVN-Revision: 3180

15 years agoUse mbstowcs() at __la_win_permissive_name() instead of MultiByteToWideChar() with...
Michihiro NAKAJIMA [Fri, 8 Apr 2011 07:45:20 +0000 (03:45 -0400)] 
Use mbstowcs() at __la_win_permissive_name() instead of MultiByteToWideChar() with CP_ACP, and
Reduce the effect of locale from the functions which used __la_win_permissive_name().

SVN-Revision: 3179

15 years agoOn Windows, Improve a conversion MBS<==>WCS to be related with setlocale().
Michihiro NAKAJIMA [Fri, 8 Apr 2011 06:37:01 +0000 (02:37 -0400)] 
On Windows, Improve a conversion MBS<==>WCS to be related with setlocale().
use of _get_current_locale() was good but msys does not provide, use of CP_ACP
mostly worked well but it ignored the locale set by setlocale().
I was finding the best solution for that issue and I finally found that
setlocale(LC_CTYPE, NULL) always returned current CodePage like this
"English_United States.1252", so we can get the current CodePage through
setlocale().

SVN-Revision: 3178

15 years agoAdd filenames conversion tests for Windows.
Michihiro NAKAJIMA [Thu, 7 Apr 2011 16:26:12 +0000 (12:26 -0400)] 
Add filenames conversion tests for Windows.
We have to check WCS(UTF-16) filenames for those tests because MBS
byte sequence cab be different if the current locale is different.
For example, MBS in CP932 can together describe CP866 by using
escape sequence so you can see a CP866 specific character in non
CP866 CodePage but cannot compare byte sequence to formal CP866 byte
sequence because of the escape sequence.

SVN-Revision: 3177

15 years agoAdd some test for zip reader.
Michihiro NAKAJIMA [Thu, 7 Apr 2011 14:17:14 +0000 (10:17 -0400)] 
Add some test for zip reader.
 - read Russian filenames in KOI8-R.
 - read Russian filenames in CP866.
 - read Russian filenames in UTF-8.

SVN-Revision: 3176

15 years agoThe filenames in pax should be written in UTF-8 without hdrcharset=UTF-8 option.
Michihiro NAKAJIMA [Thu, 7 Apr 2011 12:01:19 +0000 (08:01 -0400)] 
The filenames in pax should be written in UTF-8 without hdrcharset=UTF-8 option.

SVN-Revision: 3175

15 years agoRemove old, redundant test code.
Michihiro NAKAJIMA [Thu, 7 Apr 2011 11:49:02 +0000 (07:49 -0400)] 
Remove old, redundant test code.

SVN-Revision: 3174

15 years agoUpdate Windows CodePage look-up table.
Michihiro NAKAJIMA [Thu, 7 Apr 2011 10:27:14 +0000 (06:27 -0400)] 
Update Windows CodePage look-up table.

SVN-Revision: 3173

15 years agoIntroduce
Michihiro NAKAJIMA [Thu, 7 Apr 2011 09:52:51 +0000 (05:52 -0400)] 
Introduce
   archive_string_default_conversion_for_read() and
   archive_string_default_conversion_for_write()
for conversion CP_ACP <==> CP_OEMCP(as charset for archive file) on Windows platform.
Those functions on non-Windows platform always return NULL.

SVN-Revision: 3172

15 years agoDrop a use of CRL function _get_current_locale(), which msys does not provide.
Michihiro NAKAJIMA [Thu, 7 Apr 2011 06:14:23 +0000 (02:14 -0400)] 
Drop a use of CRL function _get_current_locale(), which msys does not provide.
We should use GetACP() instead. This is simple and fast, and would work well
for the application using libarchive.
I changed my idea it is better that a use of GetOEMCP() is only in reader and writer.

SVN-Revision: 3171

15 years agoAllow hdrcharset=UTF-8 to pax writer because libarchive_test needs that for its test...
Michihiro NAKAJIMA [Thu, 7 Apr 2011 05:47:08 +0000 (01:47 -0400)] 
Allow hdrcharset=UTF-8 to pax writer because libarchive_test needs that for its test to check
if the running platform support the string conversion or not.

SVN-Revision: 3170

15 years agoUnbreak build on msys.
Michihiro NAKAJIMA [Wed, 6 Apr 2011 13:04:12 +0000 (09:04 -0400)] 
Unbreak build on msys.

SVN-Revision: 3169

15 years agoCopy lib-link.m4,lib-prefix.m4 and lib-ld.m4 from
Michihiro NAKAJIMA [Wed, 6 Apr 2011 10:42:46 +0000 (06:42 -0400)] 
Copy lib-link.m4,lib-prefix.m4 and lib-ld.m4 from
http://git.savannah.gnu.org/cgit/gnulib.git/tree/m4 into build/autoconf
so that iconv.m4 can be used without error on Ubuntu or other platforms.

SVN-Revision: 3168

15 years agoRename archive_string_append_from_unicode_to_mbs back to archive_string_append_from_w...
Michihiro NAKAJIMA [Wed, 6 Apr 2011 05:25:24 +0000 (01:25 -0400)] 
Rename archive_string_append_from_unicode_to_mbs back to archive_string_append_from_wcs_to_mbs
since we have changed the handling of WCS. we are free from WCS format.

SVN-Revision: 3167

15 years agoSimply choose a header encoding on pax writer.
Michihiro NAKAJIMA [Wed, 6 Apr 2011 05:07:14 +0000 (01:07 -0400)] 
Simply choose a header encoding on pax writer.
Do not initialize a string conversion object if unneeded.

SVN-Revision: 3166

15 years agoRename "charset" option to "hdrcharset" since the name "charset" is not clear,
Michihiro NAKAJIMA [Wed, 6 Apr 2011 04:31:40 +0000 (00:31 -0400)] 
Rename "charset" option to "hdrcharset" since the name "charset" is not clear,
in particular reading or writing pax format, the "charset" option can be used to
a content of the file stored in pax archive file, and then "hdrcharset" described
for its metadata such as filename.

SVN-Revision: 3165

15 years agotest_archive_string.c tests archive_string_sprintf a bit
Roman Neuhauser [Mon, 4 Apr 2011 22:32:58 +0000 (18:32 -0400)] 
test_archive_string.c tests archive_string_sprintf a bit

mostly concerned with storage allocation

SVN-Revision: 3164

15 years agotest_archive_string.c tests archive_strncpy
Roman Neuhauser [Mon, 4 Apr 2011 22:32:52 +0000 (18:32 -0400)] 
test_archive_string.c tests archive_strncpy

SVN-Revision: 3163

15 years agotest_archive_string.c: tests for some archive_string operations
Roman Neuhauser [Mon, 4 Apr 2011 11:36:36 +0000 (07:36 -0400)] 
test_archive_string.c: tests for some archive_string operations

SVN-Revision: 3162

15 years agoarchive_read_support_format_xar.c: multiple fixes based on Tim's comments
Roman Neuhauser [Mon, 4 Apr 2011 11:36:14 +0000 (07:36 -0400)] 
archive_read_support_format_xar.c: multiple fixes based on Tim's comments

* various helper functions take archive_read* so that they can
  call archive_set_error()
* the expat-based TOC parser should now behave correctly on errors

SVN-Revision: 3161

15 years agoarchive_read_support_format_tar.c: fix looming buffer overflow
Roman Neuhauser [Mon, 4 Apr 2011 11:35:46 +0000 (07:35 -0400)] 
archive_read_support_format_tar.c: fix looming buffer overflow

plus:

* archive_set_error right at failure
* gnu_add_sparse_entry is a function again

SVN-Revision: 3160

15 years agoarchive_read_support_format_cpio.c: archive_set_error right at failure
Roman Neuhauser [Mon, 4 Apr 2011 11:35:35 +0000 (07:35 -0400)] 
archive_read_support_format_cpio.c: archive_set_error right at failure

record_hardlink() calls archive_set_error() itself

SVN-Revision: 3159

15 years agoarchive_read_support_format_iso9660.c: plug looming buffer overflows
Roman Neuhauser [Mon, 4 Apr 2011 11:35:09 +0000 (07:35 -0400)] 
archive_read_support_format_iso9660.c: plug looming buffer overflows

all heap_add_entry(), add_entry() and relocate_dir() calls are
checked now.

heap_add_entry() takes archive_read* and calls archive_set_error()
itself so that error reporting sits right next to the error cause.

SVN-Revision: 3158

15 years agoremove archive_read_get_bidder macro again
Roman Neuhauser [Mon, 4 Apr 2011 11:34:24 +0000 (07:34 -0400)] 
remove archive_read_get_bidder macro again

Tim dislikes the hidden return statement

SVN-Revision: 3157

15 years agoGive the API caller a memory allocation failure of a string conversion object by...
Michihiro NAKAJIMA [Mon, 4 Apr 2011 07:12:16 +0000 (03:12 -0400)] 
Give the API caller a memory allocation failure of a string conversion object by returning ARCHIVE_FATAL
instead of use of __archive_errx().

SVN-Revision: 3156

15 years agoThis change almost revert r3148,r3149 because of my misunderstanding.
Michihiro NAKAJIMA [Mon, 4 Apr 2011 05:54:44 +0000 (01:54 -0400)] 
This change almost revert r3148,r3149 because of my misunderstanding.
We should use both BINARY and UTF-8(default) only to a charset for PAX header.
- Pax writer allow charset=BINARY option only.
- For Reader side, Pax header encoding does not affect other tar header, and
  Pax header parser allow only both BINARY and "ISO-IR 10646 2000 UTF-8" for hdrcharset.

SVN-Revision: 3155

15 years agoIf someone disables ENABLE_ACL or ENABLE_XATTR, we need
Tim Kientzle [Sun, 3 Apr 2011 18:31:04 +0000 (14:31 -0400)] 
If someone disables ENABLE_ACL or ENABLE_XATTR, we need
to override the cached values for the various ACL orn
xattr functions.

SVN-Revision: 3154

15 years agoChange the charset to codepage translation to be
Tim Kientzle [Sun, 3 Apr 2011 17:46:04 +0000 (13:46 -0400)] 
Change the charset to codepage translation to be
(mostly) just a lookup table.

SVN-Revision: 3153

15 years agoAdd a few charset to be translated into Windows codepage.
Michihiro NAKAJIMA [Sun, 3 Apr 2011 13:25:34 +0000 (09:25 -0400)] 
Add a few charset to be translated into Windows codepage.

SVN-Revision: 3152

15 years agoProperly check a character-set name in hdrcharset of pax header.
Michihiro NAKAJIMA [Sat, 2 Apr 2011 05:37:48 +0000 (01:37 -0400)] 
Properly check a character-set name in hdrcharset of pax header.

SVN-Revision: 3149

15 years agoAccording to IEEE Std 1003.1-2001, we can use following charset to pax writer.
Michihiro NAKAJIMA [Sat, 2 Apr 2011 05:10:30 +0000 (01:10 -0400)] 
According to IEEE Std 1003.1-2001, we can use following charset to pax writer.
 UTF-8
 BINARY
 ISO-8859-1  ISO8859-1
 ISO-8859-2  ISO8859-2
 ISO-8859-3  ISO8859-3
 ISO-8859-4  ISO8859-4
 ISO-8859-5  ISO8859-5
 ISO-8859-6  ISO8859-6
 ISO-8859-7  ISO8859-7
 ISO-8859-8  ISO8859-8
 ISO-8859-9  ISO8859-9
 ISO-8859-10 ISO8859-10
 ISO-8859-13 ISO8859-13
 ISO-8859-14 ISO8859-14
 ISO-8859-15 ISO8859-15

We should not allow other charset to a charset option of pax writer.

SVN-Revision: 3148

15 years agoFix a replacement of Windows path separator in CP932 locale.
Michihiro NAKAJIMA [Fri, 1 Apr 2011 12:07:43 +0000 (08:07 -0400)] 
Fix a replacement of Windows path separator in CP932 locale.
And update related comment.

SVN-Revision: 3147

15 years agoAdd a new line to the end of archive_read_disk_entry_from_file.c to avoid build error.
Michihiro NAKAJIMA [Fri, 1 Apr 2011 08:21:30 +0000 (04:21 -0400)] 
Add a new line to the end of archive_read_disk_entry_from_file.c to avoid build error.

SVN-Revision: 3146

15 years agoImprove the windows version of archive_read_disk_entry_from_file() to avoid using...
Michihiro NAKAJIMA [Fri, 1 Apr 2011 06:04:40 +0000 (02:04 -0400)] 
Improve the windows version of archive_read_disk_entry_from_file() to avoid using stat() family.
- Transfer the windows version of archive_read_disk_entry_from_file() into
  archive_read_disk_windows.c because there are same utility functions in
  archive_read_disk_windows.c and calling archive_read_disk_entry_from_file() from
  directory traversals is inefficient through its API.
- Use WCS for pathname to exceed the PATH_MAX limitation.
- Properly detect if the file is symbolic linked file like lstat().

SVN-Revision: 3145