From a0a35f892af5a7536b68d3d8034bcd5f298d7de1 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 20 May 2013 14:00:47 -0500 Subject: [PATCH 1/1] Cleanup and update NEWS --- NEWS | 18 ++++++++++++++++++ include/wimlib.h | 6 +++--- src/dentry.c | 5 ++--- src/extract.c | 6 +++++- src/metadata_resource.c | 3 +-- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index f7b46282..570bfe19 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,23 @@ Only the most important changes more recent than version 0.6 are noted here. +Version 1.4.1: + Paths given to wimlib-imagex on Windows are now treated case + insensitively. + + Improved behavior regarding invalid filenames; in particular, on + Windows, wimlib-imagex will, when extracting, now omit (with an option + to override this default) filenames differing only in case, or filenames + containing characters not valid on Windows. + + `wimlib-imagex update' now acquires proper privileges on Windows when + running as an Administrator. + + `wimlib-imagex update' will now complain if no image is specified when + trying to update a multi-image WIM. + + wimlib-imagex will now choose different units for progress messages, + depending on the amount of data that needs to be processed. + Version 1.4.0: Added new "extract" and "update" subcommands to wimlib-imagex, along with associated APIs in the library. These commands are intended mainly diff --git a/include/wimlib.h b/include/wimlib.h index 02f74732..7547b7c9 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -729,9 +729,9 @@ struct wimlib_capture_config { #define WIMLIB_EXTRACT_FLAG_REPLACE_INVALID_FILENAMES 0x00000800 /** On Windows, when there exist two or more files with the same case - * insensitive name (but different case sensitive names), try to extract them - * all by appending junk to the end of them, rather than extracting an - * arbitrarily only one. */ + * insensitive name but different case sensitive names, try to extract them all + * by appending junk to the end of them, rather than arbitrarily extracting only + * one. */ #define WIMLIB_EXTRACT_FLAG_ALL_CASE_CONFLICTS 0x00001000 /****************************** diff --git a/src/dentry.c b/src/dentry.c index abe5095c..d7f18990 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -479,9 +479,8 @@ calculate_subdir_offsets(struct wim_dentry *dentry, u64 *subdir_offset_p) } } -/* UNIX: Case-sensitive UTF-16LE dentry or stream name comparison. We call this - * on Windows as well to distinguish true duplicates from names differing by - * case only. */ +/* Case-sensitive UTF-16LE dentry or stream name comparison. Used on both UNIX + * (always) and Windows (sometimes) */ static int compare_utf16le_names_case_sensitive(const utf16lechar *name1, size_t nbytes1, const utf16lechar *name2, size_t nbytes2) diff --git a/src/extract.c b/src/extract.c index 5c6c38a0..d4029ef6 100644 --- a/src/extract.c +++ b/src/extract.c @@ -446,6 +446,7 @@ file_name_valid(utf16lechar *name, size_t num_chars, bool fix) } } +#ifdef __WIN32__ if (name[num_chars - 1] == cpu_to_le16(' ') || name[num_chars - 1] == cpu_to_le16('.')) { @@ -454,6 +455,7 @@ file_name_valid(utf16lechar *name, size_t num_chars, bool fix) else return false; } +#endif return true; } @@ -566,12 +568,14 @@ out_replace: #endif size_t fixed_name_num_chars = tchar_nchars; tchar fixed_name[tchar_nchars + 50]; - size_t extraction_name_nbytes; tmemcpy(fixed_name, tchar_name, tchar_nchars); fixed_name_num_chars += tsprintf(fixed_name + tchar_nchars, T(" (invalid filename #%lu)"), ++args->invalid_sequence); + #ifndef __WIN32__ + FREE(tchar_name); + #endif dentry->extraction_name = memdup(fixed_name, 2 * fixed_name_num_chars + 2); if (!dentry->extraction_name) return WIMLIB_ERR_NOMEM; diff --git a/src/metadata_resource.c b/src/metadata_resource.c index 13aa5b8d..041d1f78 100644 --- a/src/metadata_resource.c +++ b/src/metadata_resource.c @@ -101,8 +101,7 @@ read_metadata_resource(WIMStruct *wim, struct wim_image_metadata *imd) goto out_free_buf; sha1_buffer(buf, metadata_len, hash); - if (!hashes_equal(metadata_lte->hash, hash)) - { + if (!hashes_equal(metadata_lte->hash, hash)) { ERROR("Metadata resource is corrupted (invalid SHA-1 message digest)!"); ret = WIMLIB_ERR_INVALID_RESOURCE_HASH; goto out_free_buf; -- 2.43.0