Skip to content

Commit

Permalink
Add a comment about the double-call
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Apr 4, 2024
1 parent 77acde1 commit 7cc7ad6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/catkin_pkg/workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def order_paths(paths_to_order, prefix_paths):


def _is_equal_or_in_parents(dir_, path):
# On Windows, when a symlink points to a path which uses 8.3/short filenames, it doesn't
# appear that `os.path.realpath` will resolve both redirections in the same invocation.
# We need to work around this non-idempotence by invoking the function twice.
dir_ = os.path.normcase(os.path.realpath(os.path.realpath(dir_)))
path = os.path.normcase(os.path.realpath(os.path.realpath(path)))
return path == dir_ or path.startswith(dir_ + os.sep)
Expand Down

0 comments on commit 7cc7ad6

Please sign in to comment.