]> wimlib.net Git - wimlib/commitdiff
Misc fixes
authorEric Biggers <ebiggers3@gmail.com>
Sun, 29 Dec 2013 20:21:10 +0000 (14:21 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 29 Dec 2013 20:21:10 +0000 (14:21 -0600)
NEWS
README
doc/imagex.1.in
include/wimlib.h
programs/imagex.c
src/dentry.c
src/extract.c
src/lzx-compress.c
src/wim.c
src/xml.c

diff --git a/NEWS b/NEWS
index 000ac46e6ac3fa135bbc0629a5582221ac8d3c4d..89b5b93da6aa857c9ef38890dc0ddd5e2a712992 100644 (file)
--- 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.
        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
 
        `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.
 
        `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_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
 
 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 a01d5116fb14d085a5811ce1d24a42c704def77d..ab94e55cbcb91e6b3ffad902415234e2510f162d 100644 (file)
--- 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.
 
 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.
 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.
index d9543c70f187f89c6a161f13450648a7c6c11ae1..1fecaa2429ce5b15d5faffb2e767381c75cceb62 100644 (file)
@@ -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
 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
 .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,
 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
 .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.
 .PP
 Regardless of these settings, options and non-path arguments must be specified
 in lower case.
index fcc88b028cf4c44b3a6a94d4a4effead6fae0e22..119c5870ca8fbf72ff69e110abf9b98ac9493001 100644 (file)
@@ -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
 
 /**
  * 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
  * 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
  *     ::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
  *
  * @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);
  */
 extern int
 wimlib_set_output_chunk_size(WIMStruct *wim, uint32_t chunk_size);
index 142d809163af8ea019bd22fee93a41ddc3056099..39ed2742fcaca2fd40e9af9b3deecde241bad041 100644 (file)
@@ -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;
        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);
 
 
        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(".");
        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);
        int listfile_extract_flags = WIMLIB_EXTRACT_FLAG_GLOB_PATHS;
 
        STRING_SET(refglobs);
index 1abe6ba75b69d18c9190537d16c4bf0ec9331343..3b15a44b6166eb534d8e19e4dec4fd248c0e1497 100644 (file)
@@ -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,
                        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;
                        {
                                if (idx_ret)
                                        *idx_ret = i;
index 40838c4a74b1c4947800fd06f7ea0d0fd8564613..6f49c67526183dfd6c26856a8323e42f1e32658b 100644 (file)
@@ -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);
 
                                /* 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;
                                        goto out_free_found_lte;
+                               }
 
                                ret = extract_full_stream_to_fd(needed_lte,
                                                                &tmpfile_fd);
 
                                ret = extract_full_stream_to_fd(needed_lte,
                                                                &tmpfile_fd);
index e4676dca55612bdea066e30b4afdfc61cb7ddb14..6b520ae5f05634eb35d3ab3e36a9c97e5edd20fc 100644 (file)
  * block splitting is done; only compressing the full input into an aligned
  * offset block is considered.
  *
  * 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
  * ===============
  *
  * Acknowledgments
  * ===============
  *
index 498821bc2bffab8e38081d778d95df730486e137..f4353a1dbf29bc391a78b6b584fdeef37dfca5d5 100644 (file)
--- 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->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;
        info->part_number = wim->hdr.part_number;
        info->total_parts = wim->hdr.total_parts;
        info->compression_type = wim->compression_type;
index 6afede981d05d9649a9699e80b8eb31a3bcf0f2d..142c1a91a6f4d9f20dba78454a56ba66c6e6d906 100644 (file)
--- 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;
 
        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);
        for_node_child(string_node, child) {
                if (node_is_text(child) && child->content) {
                        ret = utf8_to_tstr_simple(child->content, &tstr);