]> wimlib.net Git - wimlib/blobdiff - src/extract.c
Windows: improved error messages
[wimlib] / src / extract.c
index c61dac764dfc612e36872c099100ca0c643af58f..a5be7d1b333486bc21cdf4e24626b4e61b6ca124 100644 (file)
@@ -144,16 +144,22 @@ dentry_is_supported(struct wim_dentry *dentry,
        struct wim_inode *inode = dentry->d_inode;
 
        if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {
-               return supported_features->reparse_points ||
-                       (inode_is_symlink(inode) &&
-                        supported_features->symlink_reparse_points);
+               if (!(supported_features->reparse_points ||
+                     (inode_is_symlink(inode) &&
+                      supported_features->symlink_reparse_points)))
+                       return false;
        }
+
        if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {
-               if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)
-                       return supported_features->encrypted_directories != 0;
-               else
-                       return supported_features->encrypted_files != 0;
+               if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) {
+                       if (!supported_features->encrypted_directories)
+                               return false;
+               } else {
+                       if (!supported_features->encrypted_files)
+                               return false;
+               }
        }
+
        return true;
 }
 
@@ -808,7 +814,7 @@ dentry_calculate_extraction_name(struct wim_dentry *dentry,
 {
        int ret;
 
-       if (!dentry_is_supported(dentry, &ctx->supported_features))
+       if (unlikely(!dentry_is_supported(dentry, &ctx->supported_features)))
                goto skip_dentry;
 
        if (dentry_is_root(dentry))
@@ -1086,9 +1092,6 @@ ref_unnamed_stream(struct wim_dentry *dentry, struct apply_ctx *ctx)
        unsigned stream_idx;
        struct wim_lookup_table_entry *stream;
 
-       if (unlikely(inode_is_encrypted_directory(inode)))
-               return 0;
-
        if (unlikely(ctx->apply_ops->will_externally_back)) {
                ret = (*ctx->apply_ops->will_externally_back)(dentry, ctx);
                if (ret >= 0) {