Skip to content

Commit

Permalink
fixup! Add functionality for converting UNIX paths in arguments and e…
Browse files Browse the repository at this point in the history
…nvironment variables to Windows form for native Win32 applications.

With this commit, the POSIX-to-Windows conversion also leaves Git's
`<rev>:./<name>` syntax alone. Such a string would otherwise be mistaken
for indicating a path list, but path lists are expected to contain only
absolute paths, which would not be the case here.

This fixes Git's t1506-rev-parse-diagnosis.sh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Dec 2, 2023
1 parent 65def0b commit fc61459
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions winsup/cygwin/msys2_path_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
// Avoid mangling IPv6 addresses
if (it + 1 < end && it[1] == ':')
goto skip_p2w;

// Leave Git's <rev>:./name syntax alone
if (it + 1 < end && it[1] == '.') {
if (it + 2 < end && it[2] == '/')
goto skip_p2w;
if (it + 3 < end && it[2] == '.' && it[3] == '/')
goto skip_p2w;
}
break;
}
++it;
Expand Down

0 comments on commit fc61459

Please sign in to comment.