X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fsymlink.c;h=d2a1f84fcc1d5af829fb3c5abf3a3e2c83e33897;hp=03f78370bb7442bb56f95c20cf79813eb25996a7;hb=200bd141bea66770dd9845a95f2403d59956b931;hpb=b1c4e6a269ae4c969060e33685db12f76a204a58 diff --git a/src/symlink.c b/src/symlink.c index 03f78370..d2a1f84f 100644 --- a/src/symlink.c +++ b/src/symlink.c @@ -131,9 +131,9 @@ void *make_symlink_reparse_data_buf(const char *symlink_target, size_t *len_ret) /* XXX Fix absolute paths */ u8 *p = buf; - p = put_u16(p, 0); /* Substitute name offset */ + p = put_u16(p, utf16_len); /* Substitute name offset */ p = put_u16(p, utf16_len); /* Substitute name length */ - p = put_u16(p, utf16_len); /* Print name offset */ + p = put_u16(p, 0); /* Print name offset */ p = put_u16(p, utf16_len); /* Print name length */ p = put_u32(p, 1); p = put_bytes(p, utf16_len, name_utf16); @@ -145,8 +145,10 @@ out: return buf; } -/* Get the symlink target from a dentry that's already checked to be either a - * "real" symlink or a junction point. */ +/* Get the symlink target from a dentry. + * + * The dentry may be either "real" symlink or a junction point. + */ ssize_t dentry_readlink(const struct dentry *dentry, char *buf, size_t buf_len, const WIMStruct *w) { @@ -192,7 +194,7 @@ static int dentry_set_symlink_buf(struct dentry *dentry, wimlib_assert(dentry->num_ads == 0); wimlib_assert(dentry->ads_entries == NULL); - ads_entries[1].lte = lte; + ads_entries[0].lte = lte; /*dentry_free_ads_entries(dentry);*/ dentry->num_ads = 2;