Fix GN freeze on generating Visual Studio projects

There's an infinite loop while searching for parent directory. It happens
when drive letter case is mixed in absolute paths on Windows (/C:/foo and
/c:/foo). It's easily reproducible on MSYS terminals when system-absolute
paths are used for some targets and source root-absolute (//foo/bar) paths
are used for other targets.

BUG=

Review URL: https://codereview.chromium.org/1897213002

Cr-Original-Commit-Position: refs/heads/master@{#388443}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e4b98e2d9ff4fceae0d515d5795e677ff4518223
2 files changed
tree: f3e2151f4c68c9cb8d944b0beb4011af54a5826b
  1. tools/