mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:21:07 +00:00
Make MemoryResourceProvider.convertPath() work with partially posix paths.
So that 'C:\some\path/to/file.dart' -> 'C:\some\path\to\file.dart'. R=paulberry@google.com, brianwilkerson@google.com BUG= Review URL: https://codereview.chromium.org/2542793003 .
This commit is contained in:
parent
106c623a9f
commit
aaaeee5bc4
|
@ -50,10 +50,11 @@ class MemoryResourceProvider implements ResourceProvider {
|
||||||
* this class are never converted automatically.
|
* this class are never converted automatically.
|
||||||
*/
|
*/
|
||||||
String convertPath(String path) {
|
String convertPath(String path) {
|
||||||
if (pathContext.style == pathos.windows.style &&
|
if (pathContext.style == pathos.windows.style) {
|
||||||
path.startsWith(pathos.posix.separator)) {
|
if (path.startsWith(pathos.posix.separator)) {
|
||||||
path = r'C:' +
|
path = r'C:' + path;
|
||||||
path.replaceAll(pathos.posix.separator, pathos.windows.separator);
|
}
|
||||||
|
path = path.replaceAll(pathos.posix.separator, pathos.windows.separator);
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue