]> wimlib.net Git - wimlib/blobdiff - src/solid.c
v1.14.4
[wimlib] / src / solid.c
index ab00b0fa74539987a6fa72a88e3a675223ef37c7..a6aef41835ce93153a7f7fbbf7da31da5461ec78 100644 (file)
@@ -18,7 +18,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public License
- * along with this file; if not, see http://www.gnu.org/licenses/.
+ * along with this file; if not, see https://www.gnu.org/licenses/.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -115,9 +115,9 @@ blob_set_solid_sort_name_from_inode(struct blob_descriptor *blob,
 
        /* If this file has multiple names, choose the shortest one.  */
        inode_for_each_dentry(dentry, inode) {
-               if (dentry->file_name_nbytes < best_name_nbytes) {
-                       best_name = dentry->file_name;
-                       best_name_nbytes = dentry->file_name_nbytes;
+               if (dentry->d_name_nbytes < best_name_nbytes) {
+                       best_name = dentry->d_name;
+                       best_name_nbytes = dentry->d_name_nbytes;
                }
        }
        blob->solid_sort_name = utf16le_dupz(best_name, best_name_nbytes);
@@ -136,13 +136,14 @@ dentry_fill_in_solid_sort_names(struct wim_dentry *dentry, void *_blob_table)
        const struct wim_inode *inode = dentry->d_inode;
        const u8 *hash;
        struct hlist_head *head;
-       struct hlist_node *cur;
        struct blob_descriptor *blob;
 
        hash = inode_get_hash_of_unnamed_data_stream(inode);
+       if (!hash) /* unhashed? */
+               return 0;
        head = &blob_table->table[load_size_t_unaligned(hash) %
                                  blob_table->capacity];
-       hlist_for_each_entry(blob, cur, head, hash_list_2) {
+       hlist_for_each_entry(blob, head, hash_list_2) {
                if (hashes_equal(hash, blob->hash)) {
                        blob_set_solid_sort_name_from_inode(blob, inode);
                        break;
@@ -205,8 +206,8 @@ sort_blob_list_for_solid_compression(struct list_head *blob_list)
                                                         blob_table.capacity]);
                        break;
                case BLOB_IN_FILE_ON_DISK:
-       #ifdef __WIN32__
-               case BLOB_IN_WINNT_FILE_ON_DISK:
+       #ifdef _WIN32
+               case BLOB_IN_WINDOWS_FILE:
        #endif
                        blob_set_solid_sort_name_from_inode(blob, blob->file_inode);
                        break;