Skip to content

Commit

Permalink
Cater for different drive letters when normalizing path
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-sm committed Feb 6, 2024
1 parent 4831827 commit 9e93115
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions foreign_cc/private/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,9 @@ def _print_env():
]

def _normalize_path(path):
# Change Windows style paths to Unix style. E.g. change "C:" to "/c"
if path[0].isalpha() and path[1] == ":":
path = path.replace(path[0:2], "/" + path[0].lower())

return path.replace("\\", "/").replace(";", ":")
# Change Windows style paths to Unix style. E.g. change "C:" to "/C"
# Also try to account for varying drive letters in the path
return "/" + path.replace("\\", "/").replace(":/", "/").replace(";", ":/")

def _correct_path_variable(env):
value = env.get("PATH", "")
Expand Down

0 comments on commit 9e93115

Please sign in to comment.