changeset 21:8c6302226917

Use relative paths.
author Mikhail Kryshen <mikhail@kryshen.net>
date Wed, 22 Apr 2009 01:48:11 +0400
parents fe2a094f4509
children 1bd3a6740cfb
files src/kryshen/tema/FunctionDataParser.java src/kryshen/tema/GlobalContext.java
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/kryshen/tema/FunctionDataParser.java	Tue Apr 21 20:49:53 2009 +0400
+++ b/src/kryshen/tema/FunctionDataParser.java	Wed Apr 22 01:48:11 2009 +0400
@@ -205,7 +205,11 @@
         
         if (file.isAbsolute())
             return file;
-        
-        return new File(tp.getContext().getBaseDirectory(), path);
+
+        File base = tp.getContext().getBaseDirectory();
+
+        return base.getPath().isEmpty()
+                ? new File(path)
+                : new File(base, path);
     }
 }
--- a/src/kryshen/tema/GlobalContext.java	Tue Apr 21 20:49:53 2009 +0400
+++ b/src/kryshen/tema/GlobalContext.java	Wed Apr 22 01:48:11 2009 +0400
@@ -37,7 +37,7 @@
 class GlobalContext extends Context {    
     
     GlobalContext() {
-        super(new File(System.getProperty("user.dir")));
+        super(new File(""));
         
         // Register all standard functions.
         // TODO: arithmetics