X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fsymlink.c;h=3e89a88eead6cfed31980c86f9f4fd51a2e5ca4e;hb=a2c56fd332b6c37026b24c8a216e0ff0bf140d80;hp=5b8fe6f3ae7460ae437144f648edb54ceec067f7;hpb=a73db0665d3154b413e1ba16dd15008abc4b46fa;p=wimlib diff --git a/src/symlink.c b/src/symlink.c index 5b8fe6f3..3e89a88e 100644 --- a/src/symlink.c +++ b/src/symlink.c @@ -105,7 +105,7 @@ static ssize_t get_symlink_name(const u8 *resource, size_t resource_len, translated_target += 4; link_target_len -= 4; /* There's a drive letter, so just leave the backslashes since - * it won't go anyhwere on UNIX anyway... + * it won't go anyhwere on UNIX anyway... * * XXX * NTFS-3g tries to re-map these links to actually point to @@ -185,8 +185,8 @@ ssize_t inode_readlink(const struct inode *inode, char *buf, size_t buf_len, buf_len, inode->reparse_tag); } -/* - * Sets @dentry to be a symbolic link pointing to @target. +/* + * Sets @inode to be a symbolic link pointing to @target. * * A lookup table entry for the symbolic link data buffer is created and * inserted into @lookup_table, unless there is an existing lookup table entry @@ -206,14 +206,14 @@ int inode_set_symlink(struct inode *inode, const char *target, struct lookup_table_entry *lte = NULL, *existing_lte; u8 symlink_buf_hash[SHA1_HASH_SIZE]; void *symlink_buf; - + symlink_buf = make_symlink_reparse_data_buf(target, &symlink_buf_len); if (!symlink_buf) return WIMLIB_ERR_NOMEM; DEBUG("Made symlink reparse data buf (len = %zu, name len = %zu)", symlink_buf_len, symlink_buf_len); - + sha1_buffer(symlink_buf, symlink_buf_len, symlink_buf_hash); existing_lte = __lookup_resource(lookup_table, symlink_buf_hash); @@ -248,9 +248,6 @@ int inode_set_symlink(struct inode *inode, const char *target, if (lte_ret) *lte_ret = lte; return 0; -out_free_lte: - if (lte != existing_lte) - FREE(lte); out_free_symlink_buf: FREE(symlink_buf); return ret;