Commit 28506981 authored by Hans Wennborg's avatar Hans Wennborg Committed by Stephen Hines
Browse files

Win: handle \\?\UNC\ prefix in realPathFromHandle (PR43204)

After r361885, realPathFromHandle() ends up getting called on the working
directory on each Clang invocation. This unveiled that the code didn't work for
paths on network shares.

For example, if one maps the local dir c:\src\tmp to x:

  net use x: \\localhost\c$\tmp

and run e.g. "clang -c foo.cc" in x:\, realPathFromHandle will get
\\?\UNC\localhost\c$\src\tmp\ back from GetFinalPathNameByHandleW, and would
strip off the initial \\?\ prefix, ending up with a path that doesn't work.

This patch makes the prefix stripping a little smarter to handle this case.

Differential revision: https://reviews.llvm.org/D67166

Change-Id: Ia7c6e9955bf854a95d9184c6571f9293d467f76f
llvm-svn: 371035
(cherry picked from commit 91a5a2af)
parent e0caee08
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment