From: Eric Biggers Date: Thu, 11 Feb 2016 01:55:36 +0000 (-0600) Subject: win32_apply.c: explicitly remove extra slashes in link targets X-Git-Tag: v1.9.1~37 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=33e8240edea55d28cd9bafae542f4d571459a181 win32_apply.c: explicitly remove extra slashes in link targets --- diff --git a/src/win32_apply.c b/src/win32_apply.c index 3a2c077d..a96fbd4b 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -2120,6 +2120,15 @@ try_rpfix(struct reparse_buffer_disk *rpbuf, u16 *rpbuflen_p, ctx->target_ntpath.Buffer[target_ntpath_nchars - 1] == L'\\') target_ntpath_nchars--; + /* Also remove extra slashes from the beginning of 'relpath'. Normally + * this isn't needed, but this is here to make the extra slash(es) added + * by wimlib pre-v1.9.1 get removed automatically. */ + while (relpath_nchars >= 2 && + relpath[0] == L'\\' && relpath[1] == L'\\') { + relpath++; + relpath_nchars--; + } + fixed_subst_name_nchars = target_ntpath_nchars + relpath_nchars; wchar_t fixed_subst_name[fixed_subst_name_nchars];