aboutsummaryrefslogtreecommitdiff
path: root/lib/System/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/System/Path.cpp')
-rw-r--r--lib/System/Path.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp
index c5a4b0676f..4c965db722 100644
--- a/lib/System/Path.cpp
+++ b/lib/System/Path.cpp
@@ -207,6 +207,18 @@ bool Path::hasMagicNumber(const std::string &Magic) const {
return false;
}
+void Path::makeAbsolute() {
+ if (isAbsolute())
+ return;
+
+ Path CWD = Path::GetCurrentDirectory();
+ assert(CWD.isAbsolute() && "GetCurrentDirectory returned relative path!");
+
+ CWD.appendComponent(path);
+
+ path = CWD.toString();
+}
+
static void getPathList(const char*path, std::vector<Path>& Paths) {
const char* at = path;
const char* delim = strchr(at, PathSeparator);