Update bug fixes
authorEric Biggers <ebiggers3@gmail.com>
Sun, 12 May 2013 06:09:44 +0000 (01:09 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 12 May 2013 06:09:44 +0000 (01:09 -0500)
src/hardlink.c
src/lookup_table.c
src/update_image.c

index 53d03ec..90446f9 100644 (file)
@@ -550,7 +550,6 @@ inode_table_prepare_inode_list(struct wim_inode_table *table,
                        inode->i_ino = cur_ino++;
                else
                        inode->i_ino = 0;
-               list_add_tail(&inode->i_list, head);
        }
 
        for (size_t i = 0; i < table->capacity; i++) {
index e2ca592..e2ce02e 100644 (file)
@@ -240,7 +240,9 @@ lte_decrement_refcnt(struct wim_lookup_table_entry *lte,
        wimlib_assert(lte != NULL);
        wimlib_assert(lte->refcnt != 0);
        if (--lte->refcnt == 0) {
-               if (!lte->unhashed)
+               if (lte->unhashed)
+                       list_del(&lte->unhashed_list);
+               else
                        lookup_table_unlink(table, lte);
        #ifdef WITH_FUSE
                if (lte->num_opened_fds == 0)
index 650dfbb..788cd9e 100644 (file)
@@ -295,6 +295,8 @@ execute_delete_command(WIMStruct *wim,
        flags = delete_cmd->delete.delete_flags;
        wim_path = delete_cmd->delete.wim_path;
 
+       DEBUG("Deleting WIM path \"%"TS"\" (flags=%#x)", wim_path, flags);
+
        tree = get_dentry(wim, wim_path);
        if (!tree) {
                /* Path to delete does not exist in the WIM. */
@@ -574,7 +576,7 @@ free_update_commands(struct wimlib_update_command *cmds, size_t num_cmds)
 {
        if (cmds) {
                for (size_t i = 0; i < num_cmds; i++) {
-                       switch (cmds->op) {
+                       switch (cmds[i].op) {
                        case WIMLIB_UPDATE_OP_ADD:
                                FREE(cmds[i].add.fs_source_path);
                                FREE(cmds[i].add.wim_target_path);
@@ -587,6 +589,8 @@ free_update_commands(struct wimlib_update_command *cmds, size_t num_cmds)
                                FREE(cmds[i].rename.wim_source_path);
                                FREE(cmds[i].rename.wim_target_path);
                                break;
+                       default:
+                               wimlib_assert(0);
                        }
                }
                FREE(cmds);