diff --git a/src/support/os_cygwin.cpp b/src/support/os_cygwin.cpp index 3ab910fedd..1bfffdc828 100644 --- a/src/support/os_cygwin.cpp +++ b/src/support/os_cygwin.cpp @@ -185,7 +185,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how) if (i + 1 != p2.length()) return false; - if (!prefixIs(path, pre) && how == CASE_ADJUSTED) + if (how == CASE_ADJUSTED && !prefixIs(path, pre)) path = to_utf8(p2 + p1.substr(i + 1, p1.length() - i + 1)); return true; diff --git a/src/support/os_unix.cpp b/src/support/os_unix.cpp index 976fcf75e8..15c5e63369 100644 --- a/src/support/os_unix.cpp +++ b/src/support/os_unix.cpp @@ -98,7 +98,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how) if (i + 1 != p2.length()) return false; - if (!prefixIs(path, pre) && how == CASE_ADJUSTED) + if (how == CASE_ADJUSTED && !prefixIs(path, pre)) path = to_utf8(p2 + p1.substr(i + 1, p1.length() - i + 1)); return true; diff --git a/src/support/os_win32.cpp b/src/support/os_win32.cpp index 732cdc55ab..722895b1cf 100644 --- a/src/support/os_win32.cpp +++ b/src/support/os_win32.cpp @@ -216,7 +216,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how) if (i + 1 != p2.length()) return false; - if (!prefixIs(path, pre) && how == CASE_ADJUSTED) + if (how == CASE_ADJUSTED && !prefixIs(path, pre)) path = to_utf8(p2 + p1.substr(i + 1, p1.length() - i + 1)); return true;