From f4fd10ea6181d458258700d70091c5ece876696b Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 7 Mar 2016 15:41:42 +0000
Subject: [PATCH] if dirname is empty, don't add a path separator

---
 contrib/onelab/python/onelab.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/onelab/python/onelab.py b/contrib/onelab/python/onelab.py
index 6f16aea0f5..01195a7af8 100755
--- a/contrib/onelab/python/onelab.py
+++ b/contrib/onelab/python/onelab.py
@@ -34,7 +34,8 @@ def path(dirname, inp):
   # dirname is a directory, can be empty
   # inp is an optional file or subdirectory name
   # returns the path to 'inp' in the same directory as 'ref' 
-  dirname = os.path.dirname(dirname + os.sep)
+  if dirname:
+    dirname = os.path.dirname(dirname + os.sep)
   if not inp: 
     return dirname
   if inp[0] == '/' or inp[0] == '\\' or (len(inp) > 2 and inp[1] == '\:'):
-- 
GitLab