Skip to content

Commit

Permalink
pathconv: Check for end of input when determining potential path list
Browse files Browse the repository at this point in the history
Suggested-by: Richard Copley <buster@buster.me.uk>
  • Loading branch information
ReinhardBiegelIntech committed Jul 2, 2024
1 parent 222fa6e commit a907109
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions winsup/cygwin/msys2_path_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,15 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en

/*
* Discern between Git's `<rev>:<path>`, SCP's `<host>:<path>` pattern
* (which is not a path list but may naïvely look like one) on the one
* (which is not a path list but may naively look like one) on the one
* hand, and path lists starting with `/<path>`, `./<path>` or `../<path>`
* on the other hand.
*/
bool potential_path_list = *it == '/' ||
(*it == '.' &&
(it[1] == ':' || it[1] == '/' ||
(it[1] == '.' &&
(it[2] == ':' || it[2] == '/'))));
(*it == '.' &&
(it + 1 == end || it[1] == '\0' || it[1] == ':' || it[1] == '/' ||
(it[1] == '.' &&
(it + 2 == end || it[2] == '\0' || it[2] == ':' || it[2] == '/'))));

/*
* Determine if assignment to an environment variable takes place (and
Expand Down

0 comments on commit a907109

Please sign in to comment.