Commit a190d3bf authored by Carsten Emde's avatar Carsten Emde
Browse files

Considered a second code location to apply the most recent fix

parent 83464f04
......@@ -466,7 +466,10 @@ def main(argv):
# store the length of the top level directory, as everything
# will be relative to it and the graph should be free of
# hardcoded paths.
topdirlength = len(dirtoscan)
if dirtoscan == '/':
topdirlength = 0
else:
topdirlength = len(dirtoscan)
dirwalker = os.walk(dirtoscan)
......@@ -488,10 +491,7 @@ def main(argv):
if args.verbose:
print(fullfilename)
if dirtoscan == '/':
relfullfilename = fullfilename
else:
relfullfilename = fullfilename[topdirlength:]
relfullfilename = fullfilename[topdirlength:]
if os.path.islink(fullfilename):
# keep checking whether or not a symlink can be resolved
......@@ -539,7 +539,10 @@ def main(argv):
break
else:
# the target is an actual file
symlink_to_target[relfullfilename] = targetfile[topdirlength:]
if dirtoscan == '/':
symlink_to_target[relfullfilename] = targetfile
else:
symlink_to_target[relfullfilename] = targetfile[topdirlength:]
break
if not os.path.basename(fullfilename) in filename_to_full_path:
filename_to_full_path[os.path.basename(fullfilename)] = set()
......
Markdown is supported
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