X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Freparse.c;h=4cbe69d9fbda8b7ce7ab43571240b4f2a1a94548;hp=a245a7e16a455e0575d8caffab6ae002d20f3503;hb=9c5469aa171f34e1af510a8a98ec056d27979bbf;hpb=5592f3bfcf0c2da0d8b9da8ec3f4c479e410aa0a diff --git a/src/reparse.c b/src/reparse.c index a245a7e1..4cbe69d9 100644 --- a/src/reparse.c +++ b/src/reparse.c @@ -465,6 +465,12 @@ capture_fixup_absolute_symlink(tchar *dest, { tchar *p = dest; +#ifdef __WIN32__ + /* Skip drive letter */ + if (!is_rp_path_separator(*dest)) + p += 2; +#endif + DEBUG("Fixing symlink or junction \"%"TS"\"", dest); for (;;) { tchar save; @@ -491,6 +497,13 @@ capture_fixup_absolute_symlink(tchar *dest, *(p - 1) = RP_PATH_SEPARATOR; while (p - 1 >= dest && is_rp_path_separator(*(p - 1))) p--; + #ifdef __WIN32__ + if (!is_rp_path_separator(dest[0])) { + *--p = dest[1]; + *--p = dest[0]; + } + #endif + wimlib_assert(p >= dest); return p; }