diff options
| author | klutzy <klutzytheklutzy@gmail.com> | 2014-08-23 15:58:38 +0900 |
|---|---|---|
| committer | klutzy <klutzytheklutzy@gmail.com> | 2014-08-23 16:19:07 +0900 |
| commit | 7eb35bc2a9dcc0a7cd91fb247d156eb87df25b27 (patch) | |
| tree | 4b69e9e42ef23c64a661e16f0afafca26c4b1fcb /src | |
| parent | a3d77e616bb8455e158c22a379b655437916d404 (diff) | |
| download | rust-7eb35bc2a9dcc0a7cd91fb247d156eb87df25b27.tar.gz rust-7eb35bc2a9dcc0a7cd91fb247d156eb87df25b27.zip | |
test: Convert Window path to MSYS path
When MSYS shell executes program, if its arguments look like MSYS paths, MSYS automatically converts them into Windows paths. For example, `/c/path:/d/path` becomes `C:\path;D:\path`. However, if there is only one path e.g. `/c/path`, it becomes `C:/path`. maketest.py reverts the behavior to reduce confusion between MSYS and Windows, but it didn't handle the `/c/path` case. This patch fixes the issue. Fixes #15297 Fixes #15250
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/maketest.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/etc/maketest.py b/src/etc/maketest.py index 0e2c1e77ab4..b46a3b03600 100644 --- a/src/etc/maketest.py +++ b/src/etc/maketest.py @@ -15,13 +15,14 @@ import sys # msys1/msys2 automatically converts `/abs/path1:/abs/path2` into # `c:\real\abs\path1;c:\real\abs\path2` (semicolons) if shell thinks # the value is list of paths. +# (if there is only one path, it becomes `c:/real/abs/path`.) # this causes great confusion and error: shell and Makefile doesn't like # windows paths so it is really error-prone. revert it for peace. def normalize_path(v): - # c:\path -> /c/path - if ':\\' in v: - v = '/' + v.replace(':\\', '/') v = v.replace('\\', '/') + # c:/path -> /c/path + if ':/' in v: + v = '/' + v.replace(':/', '/') return v |
