]> arthur.barton.de Git - bup.git/commitdiff
Convert BUP_DIR to an absolute path so chdir() won't cause trouble.
authorRob Browning <rlb@defaultvalue.org>
Sat, 18 Aug 2012 19:56:05 +0000 (14:56 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 20 Oct 2012 18:12:06 +0000 (13:12 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Zoran Zaric <zz@zoranzaric.de>
main.py

diff --git a/main.py b/main.py
index 67ad0119c393255e9d0771b0d6833fef6e88c7f6..3554179d4c5a5272b2c6ec2960443fc528a30ab5 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -95,6 +95,10 @@ for opt in global_args:
     else:
         usage('error: unexpected option "%s"' % opt[0])
 
+# Make BUP_DIR absolute, so we aren't affected by chdir (i.e. save -C, etc.).
+if 'BUP_DIR' in os.environ:
+    os.environ['BUP_DIR'] = os.path.abspath(os.environ['BUP_DIR'])
+
 if len(subcmd) == 0:
     if help_requested:
         subcmd = ['help']