Skip to content

Commit

Permalink
Fixed path converting with non ascii char.
Browse files Browse the repository at this point in the history
When a non ascii char is at the beginning of a path the current conversion
destroys the path. This fix will prevent this with an extra check for
non-ascii UTF-8 characters.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: 마누엘 <nalla@hamal.uberspace.de>
  • Loading branch information
마누엘 authored and dscho committed Nov 29, 2023
1 parent a91afd4 commit 5246c13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion winsup/cygwin/msys2_path_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
}
it = *src;

while (!isalnum(*it) && *it != '/' && *it != '\\' && *it != ':' && *it != '-' && *it != '.') {
while (!isalnum(*it) && !(0x80 & *it) && *it != '/' && *it != '\\' && *it != ':' && *it != '-' && *it != '.') {
recurse = true;
it = ++*src;
if (it == end || *it == '\0') return NONE;
Expand Down

0 comments on commit 5246c13

Please sign in to comment.