X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwin32_apply.c;fp=src%2Fwin32_apply.c;h=a96fbd4b2ad0a87db774e962067a85f32c29de2b;hp=3a2c077dab34436c79732ac2be0e9ade33452b8b;hb=33e8240edea55d28cd9bafae542f4d571459a181;hpb=9f25365263682b2b8cb7ef760d9668157830f566 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];