]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/helpers.py
save: make --strip-path=/ a no-op
[bup.git] / lib / bup / helpers.py
index 715ce3389dcc9550e9447fb86025c68c2d677707..c15b357733b378105a160ec8e829f92bdfe0bdaa 100644 (file)
@@ -930,6 +930,8 @@ def stripped_path_components(path, strip_prefixes):
     sorted_strip_prefixes = sorted(strip_prefixes, key=len, reverse=True)
     for bp in sorted_strip_prefixes:
         normalized_bp = os.path.abspath(bp)
+        if normalized_bp == '/':
+            continue
         if normalized_path.startswith(normalized_bp):
             prefix = normalized_path[:len(normalized_bp)]
             result = []