X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fdentry.c;h=73dba52b26fa68943a8f827389018b59598295b7;hb=f9695b9f40035f1a20968293255761a8301eaba0;hp=698e137c10dab4f90d0f744111e56d6629f28cde;hpb=8244af933d579b3dcd6245a6995d96a86e5ab322;p=wimlib diff --git a/src/dentry.c b/src/dentry.c index 698e137c..73dba52b 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -711,6 +711,7 @@ new_timeless_inode() inode->i_nlink = 1; inode->i_next_stream_id = 1; inode->i_not_rpfixed = 1; + INIT_LIST_HEAD(&inode->i_list); #ifdef WITH_FUSE if (pthread_mutex_init(&inode->i_mutex, NULL) != 0) { ERROR_WITH_ERRNO("Error initializing mutex"); @@ -843,9 +844,10 @@ free_inode(struct wim_inode *inode) wimlib_assert(inode->i_num_opened_fds == 0); FREE(inode->i_fds); pthread_mutex_destroy(&inode->i_mutex); - if (inode->i_hlist.pprev) - hlist_del(&inode->i_hlist); #endif + /* HACK: This may instead delete the inode from i_list, but the + * hlist_del() behaves the same as list_del(). */ + hlist_del(&inode->i_hlist); FREE(inode->i_extracted_file); FREE(inode); } @@ -1129,16 +1131,12 @@ inode_set_unnamed_stream(struct wim_inode *inode, const void *data, size_t len, void *buf; sha1_buffer(data, len, hash); - existing_lte = __lookup_resource(lookup_table, hash); - if (existing_lte) { wimlib_assert(wim_resource_size(existing_lte) == len); lte = existing_lte; lte->refcnt++; } else { - void *buf; - lte = new_lookup_table_entry(); if (!lte) return WIMLIB_ERR_NOMEM; @@ -1215,7 +1213,7 @@ inode_get_unix_data(const struct wim_inode *inode, if (size != sizeof(struct wimlib_unix_data)) return BAD_UNIX_DATA; - ret = read_full_resource_into_buf(lte, unix_data, true); + ret = read_full_resource_into_buf(lte, unix_data); if (ret) return ret; @@ -1275,14 +1273,18 @@ replace_forbidden_characters(utf16lechar *name) if (*p == '/') #endif { + #ifdef __WIN32__ + *p = cpu_to_le16(0xfffd); + #else + *p = '?'; + #endif if (name) { WARNING("File, directory, or stream name \"%"WS"\"\n" " contains forbidden characters; " - "replacing them with Unicode codepoint U+001A", + "substituting replacement characters.", name); name = NULL; } - *p = 0x1a; } } }