Index: base/base_paths_mac.mm |
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm |
index 1e8bac80b7f2aa40238270b7f8f2e5c81c7239cf..db900b874ca07da9f3f9d5e84903494a5a069a66 100644 |
--- a/base/base_paths_mac.mm |
+++ b/base/base_paths_mac.mm |
@@ -32,7 +32,11 @@ void GetNSExecutablePath(base::FilePath* path) { |
int rv = _NSGetExecutablePath(WriteInto(&executable_path, executable_length), |
&executable_length); |
DCHECK_EQ(rv, 0); |
- *path = base::FilePath(executable_path); |
+ |
+ // _NSGetExecutablePath may return paths containing ./ or ../ which makes |
+ // FilePath::DirName() work incorrectly, convert it to absolute path so that |
+ // paths such as DIR_SOURCE_ROOT can work. |
+ *path = base::MakeAbsoluteFilePath(base::FilePath(executable_path)); |
Nico
2013/07/10 18:02:31
Hm, are you sure these paths never get persisted s
brettw
2013/08/06 04:52:06
We do want an absolute path here. We should be sur
|
} |
// Returns true if the module for |address| is found. |path| will contain |