aboutsummaryrefslogtreecommitdiff
path: root/lib/System/Unix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/System/Unix')
-rw-r--r--lib/System/Unix/Path.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc
index 125a0ab209..e951fa0355 100644
--- a/lib/System/Unix/Path.inc
+++ b/lib/System/Unix/Path.inc
@@ -109,6 +109,19 @@ Path::isAbsolute() const {
return false;
return path[0] == '/';
}
+
+void Path::makeAbsolute() {
+ if (isAbsolute())
+ return;
+
+ Path CWD = Path::GetCurrentDirectory();
+ assert(CWD.isAbsolute() && "GetCurrentDirectory returned relative path!");
+
+ CWD.appendComponent(path);
+
+ path = CWD.toString();
+}
+
Path
Path::GetRootDirectory() {
Path result;