From: Eric Biggers Date: Sun, 29 Dec 2013 20:21:10 +0000 (-0600) Subject: Misc fixes X-Git-Tag: v1.6.0~51 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=9d9c2fe60b5842825002131f4ca926024e6f0038 Misc fixes --- diff --git a/NEWS b/NEWS index 000ac46e..89b5b93d 100644 --- a/NEWS +++ b/NEWS @@ -38,7 +38,7 @@ Version 1.6.0: WIMs, which use a larger chunk size by default. The compression/decompression API exported by wimlib has been changed. - Now one set of functions support all supported compression formats. + Now one set of functions handles all supported compression formats. `wimcapture' and `wimappend' will now display the progress of scanning the directory tree to capture, in addition to the progress of writing @@ -49,10 +49,10 @@ Version 1.6.0: `mkwinpeimg' now correctly handles the '--start-script' option when the start script is not in the working directory. - Sequential extraction, previously required by using + Sequential extraction, previously requested by using WIMLIB_EXTRACT_FLAG_SEQUENTIAL, is now the default. - WIMLIB_EXTRACT_FLAG_FILE_ORDER can be used to get the old behavior - (extract in file order). + WIMLIB_EXTRACT_FLAG_FILE_ORDER can be used to get the old default + behavior (extract in file order). Version 1.5.3: The new LZX compressor added in v1.5.2 has been improved and is now diff --git a/README b/README index a01d5116..ab94e55c 100644 --- a/README +++ b/README @@ -89,7 +89,7 @@ The above LZX data are using explicitly specified maximum compression faster LZX compressor is used; it will produce results in between those given for XPRESS and LZX above. -Note: if the absolute maximum (but still compatible; i.e. not changing the +Note: if the absolute maximum but still compatible (i.e. not changing the compression chunk size) LZX compression ratio is desired, `wimlib-imagex optimize WIMFILE --recompress --compress-slow' on one of the above LZX-compressed WIMs produces a WIM of 187,089,943 bytes in about 400 seconds. diff --git a/doc/imagex.1.in b/doc/imagex.1.in index d9543c70..1fecaa24 100644 --- a/doc/imagex.1.in +++ b/doc/imagex.1.in @@ -170,10 +170,9 @@ mounting an image from a split WIM, but Microsoft's software does not. (Note: this functionality is not available in Windows builds of wimlib and \fB@IMAGEX_PROGNAME@\fR.) .SH LOCALES AND CHARACTER ENCODINGS -WIM files themselves store file and stream names using the UTF16-LE. On -Windows, wimlib works in UTF-16LE, so conversions are usually necessary and -there should be no problems with character encodings, except possibly in the XML -data. +WIM files themselves store file and stream names using UTF-16LE. On Windows, +wimlib works in UTF-16LE, so conversions are usually not necessary and there +should be no problems with character encodings. .PP On UNIX-like systems, wimlib works primarily in the locale-dependent multibyte encoding, which you are strongly recommended to set to UTF-8 to avoid any @@ -187,19 +186,19 @@ between UNIX-like systems and Windows. WIM images may (but usually do not) have multiple files with the same case-insensitive name. Internally, wimlib stores filenames as case-sensitive, but on Windows paths actually provided by the user for use in a WIM image (e.g. for extracting, -adding, renaming, or deleting files) will be treated as case-insensitive in -order to get the "expected" behavior. This differs from the default behavior on -UNIX-like systems, where such paths will be treated as case-sensitive. Note -that with case insensitively, a path component may in general be ambiguous due -to multiple files or directories having the same case-insensitive name. In such -cases, if there is a file or directory with an exactly matching name, it is -chosen; otherwise, one of the case-insensitively matching file or directories is -chosen arbitrarily. +adding, renaming, or deleting files) will by default be treated as +case-insensitive in order to get the "expected" behavior. This differs from the +default behavior on UNIX-like systems, where such paths will be treated as +case-sensitive. Note that with case insensitivity, a path component may in +general be ambiguous due to multiple files or directories having the same +case-insensitive name. In such cases, if there is a file or directory with an +exactly matching name, it is chosen; otherwise, one of the case-insensitively +matching file or directories is chosen arbitrarily. .PP The default behavior can be overwritten by explicitly setting the environmental variable \fBWIMLIB_IMAGEX_IGNORE_CASE\fR to 1, in which case such paths will be treated case insensitively, or 0, in which such paths will be treated case -sensitsively. +sensitively. .PP Regardless of these settings, options and non-path arguments must be specified in lower case. diff --git a/include/wimlib.h b/include/wimlib.h index fcc88b02..119c5870 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -2432,7 +2432,7 @@ wimlib_extract_image_from_pipe(int pipe_fd, /** * Similar to wimlib_extract_paths(), but the paths to extract from the WIM - * image specified in the UTF-8 text file named by @p path_list_file which + * image are specified in the UTF-8 text file named by @p path_list_file which * itself contains the list of paths to use, one per line. Leading and trailing * whitespace, and otherwise empty lines and lines beginning with the ';' * character are ignored. No quotes are needed as paths are otherwise delimited @@ -3357,17 +3357,18 @@ wimlib_set_image_descripton(WIMStruct *wim, int image, * ::WIMStruct for a WIM. * @param out_chunk_size * The chunk size (in bytes) to set. The valid chunk sizes are dependent - * on the compression format. The XPRESS compression format supports chunk - * sizes that are powers of 2 with exponents between 15 and 26 inclusively, - * whereas the LZX compression format supports chunk sizes that are powers - * of 2 with exponents between 15 and 21 inclusively. As a special case, - * if @p out_chunk_size is specified as 0, the chunk size is set to the - * default for the currently selected output compression type. + * on the compression format. The XPRESS and LZMS compression formats + * support chunk sizes that are powers of 2 with exponents between 15 and + * 26 inclusively, whereas the LZX compression format supports chunk sizes + * that are powers of 2 with exponents between 15 and 21 inclusively. As a + * special case, if @p out_chunk_size is specified as 0, the chunk size is + * set to the default for the currently selected output compression type. * * @return 0 on success; nonzero on error. * * @retval ::WIMLIB_ERR_INVALID_CHUNK_SIZE - * @p ctype is not a supported chunk size. + * @p chunk_size is not a supported chunk size for the currently selected + * output compression type. */ extern int wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size); diff --git a/programs/imagex.c b/programs/imagex.c index 142d8091..39ed2742 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -1552,7 +1552,7 @@ imagex_apply(int argc, tchar **argv, int cmd) const tchar *wimfile; const tchar *target; const tchar *image_num_or_name = NULL; - int extract_flags = WIMLIB_EXTRACT_FLAG_SEQUENTIAL; + int extract_flags = 0; STRING_SET(refglobs); @@ -2714,7 +2714,7 @@ imagex_extract(int argc, tchar **argv, int cmd) const tchar *image_num_or_name; const tchar *pathlist; tchar *dest_dir = T("."); - int extract_flags = WIMLIB_EXTRACT_FLAG_SEQUENTIAL | WIMLIB_EXTRACT_FLAG_NORPFIX; + int extract_flags = WIMLIB_EXTRACT_FLAG_NORPFIX; int listfile_extract_flags = WIMLIB_EXTRACT_FLAG_GLOB_PATHS; STRING_SET(refglobs); diff --git a/src/dentry.c b/src/dentry.c index 1abe6ba7..3b15a44b 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -1494,7 +1494,7 @@ inode_get_ads_entry(struct wim_inode *inode, const tchar *stream_name, if (ads_entry_has_name(&inode->i_ads_entries[i], stream_name_utf16le, stream_name_utf16le_nbytes, - false)) + default_ignore_case)) { if (idx_ret) *idx_ret = i; diff --git a/src/extract.c b/src/extract.c index 40838c4a..6f49c675 100644 --- a/src/extract.c +++ b/src/extract.c @@ -1527,8 +1527,10 @@ extract_streams_from_pipe(struct apply_ctx *ctx) /* Extract stream to temporary file. */ ret = create_temporary_file(&tmpfile_fd, &tmpfile_name); - if (ret) + if (ret) { + lte_unbind_wim_resource_spec(needed_lte); goto out_free_found_lte; + } ret = extract_full_stream_to_fd(needed_lte, &tmpfile_fd); diff --git a/src/lzx-compress.c b/src/lzx-compress.c index e4676dca..6b520ae5 100644 --- a/src/lzx-compress.c +++ b/src/lzx-compress.c @@ -124,41 +124,6 @@ * block splitting is done; only compressing the full input into an aligned * offset block is considered. * - * API - * === - * - * The old API (retained for backward compatibility) consists of just one - * function: - * - * wimlib_lzx_compress() - * - * The new compressor has more potential parameters and needs more memory, so - * the new API ties up memory allocations and compression parameters into a - * context: - * - * wimlib_lzx_alloc_context() - * wimlib_lzx_compress2() - * wimlib_lzx_free_context() - * wimlib_lzx_set_default_params() - * - * Both wimlib_lzx_compress() and wimlib_lzx_compress2() are designed to - * compress an in-memory buffer of up to the window size, which can be any power - * of two between 2^15 and 2^21 inclusively. However, by default, the WIM - * format uses 2^15, and this is seemingly the only value that is compatible - * with WIMGAPI. In any case, the window is not a true "sliding window" since - * no data is ever "slid out" of the window. This is needed for the WIM format, - * which is designed such that chunks may be randomly accessed. - * - * Both wimlib_lzx_compress() and wimlib_lzx_compress2() return 0 if the data - * could not be compressed to less than the size of the uncompressed data. - * Again, this is suitable for the WIM format, which stores such data chunks - * uncompressed. - * - * The functions in this LZX compression API are exported from the library, - * although with the possible exception of wimlib_lzx_set_default_params(), this - * is only in case other programs happen to have uses for it other than WIM - * reading/writing as already handled through the rest of the library. - * * Acknowledgments * =============== * diff --git a/src/wim.c b/src/wim.c index 498821bc..f4353a1d 100644 --- a/src/wim.c +++ b/src/wim.c @@ -397,7 +397,7 @@ wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info) info->image_count = wim->hdr.image_count; info->boot_index = wim->hdr.boot_idx; info->wim_version = wim->hdr.wim_version; - info->chunk_size = wim->hdr.chunk_size; + info->chunk_size = wim->chunk_size; info->part_number = wim->hdr.part_number; info->total_parts = wim->hdr.total_parts; info->compression_type = wim->compression_type; diff --git a/src/xml.c b/src/xml.c index 6afede98..142c1a91 100644 --- a/src/xml.c +++ b/src/xml.c @@ -259,6 +259,9 @@ node_get_string(const xmlNode *string_node, tchar **tstr_ret) tchar *tstr = NULL; int ret; + if (*tstr_ret) + return 0; + for_node_child(string_node, child) { if (node_is_text(child) && child->content) { ret = utf8_to_tstr_simple(child->content, &tstr);