File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,11 @@ llvm::Expected<std::string> parsePath(llvm::StringRef Path) {
150150 if (path::is_absolute (Path, path::Style::posix)) {
151151 return std::string (Path);
152152 }
153- if ( path::is_absolute (Path, path::Style::windows)) {
154- std::string Converted = path::convert_to_slash (Path, path::Style::windows);
155- if ( Converted. front () != ' / ' )
156- Converted = " / " + Converted;
157- return Converted ;
153+ llvm::StringRef Root = path::root_name (Path, path::Style::windows);
154+ if (!Root. empty ()) {
155+ std::string Converted = " / " ;
156+ return Converted. append (Root)
157+ . append ( path::convert_to_slash (Path. substr (Root. size ()), path::Style::windows)) ;
158158 }
159159 return error (" Path not absolute: {0}" , Path);
160160}
You can’t perform that action at this time.
0 commit comments