[tor-commits] [stem/master] Fixed a bug in stem.util.system.expand_path that may introduce a trailing slash.

atagar at torproject.org atagar at torproject.org
Thu Jun 21 15:45:57 UTC 2012


commit 03780a98ab131fb5ac6cf1bac192d1d7ec9f238e
Author: Beck <csybeck at gmail.com>
Date:   Wed Jun 20 01:41:37 2012 +0800

    Fixed a bug in stem.util.system.expand_path that may introduce a trailing slash.
---
 stem/util/system.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/stem/util/system.py b/stem/util/system.py
index fb27b13..3db9cc0 100644
--- a/stem/util/system.py
+++ b/stem/util/system.py
@@ -522,7 +522,10 @@ def expand_path(path, cwd = None):
     if path.startswith("./") or path.startswith(".\\"): path = path[2:]
     elif path == ".": path = ""
     
-    relative_path = os.path.join(cwd, path)
+    if path == "":
+        relative_path = cwd
+    else:
+        relative_path = os.path.join(cwd, path)
   
   return relative_path
 





More information about the tor-commits mailing list