Commit 6ae4910d authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Adjustments to commonBase function

parent c63487f8
...@@ -485,14 +485,17 @@ def commonBase(paths): ...@@ -485,14 +485,17 @@ def commonBase(paths):
depths = [len(p.split(op.sep)) for p in paths] depths = [len(p.split(op.sep)) for p in paths]
base = max(zip(depths, paths), key=operator.itemgetter(0))[1] base = max(zip(depths, paths), key=operator.itemgetter(0))[1]
last = base
while True: while True:
base = op.split(base)[0] base = op.split(base)[0]
if len(base) == 0: if base == last or len(base) == 0:
break break
last = base
if all([p.startswith(base) for p in paths]): if all([p.startswith(base) for p in paths]):
return base return base
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment