Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: sdk/lib/_internal/pub/lib/src/io.dart

Issue 331673003: Resolve symlinks before determining relative path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/io.dart
diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
index 5ae64c2489f7144a13fd7770deca42c64ab16c70..f93f34c6d2eccfb801e5519acf96d8044b2edbfc 100644
--- a/sdk/lib/_internal/pub/lib/src/io.dart
+++ b/sdk/lib/_internal/pub/lib/src/io.dart
@@ -351,8 +351,11 @@ void createSymlink(String target, String symlink,
if (Platform.operatingSystem == 'windows') {
target = path.normalize(path.absolute(target));
} else {
- target = path.normalize(
- path.relative(target, from: path.dirname(symlink)));
+ // If the directory where we're creating the symlink was itself reached
+ // by traversing a symlink, we want the relative path to be relative to
+ // it's actual location, not the one we went through to get to it.
+ var symlinkDir = canonicalize(path.dirname(symlink));
+ target = path.normalize(path.relative(target, from: symlinkDir));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698