-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected change in path conversion behaviour after #143 #150
Comments
Hmm. That's an interesting case. While I still think that the space should not exclude command-line parameters from the automatic path conversion, I see a lot of tell-tales in that
Having said that, I notice that the path conversion kicks in after the closing bracket, not for the entire path... There must be something in MSYS2's path conversion logic that considers a slash after a closing bracket as starting a "POSIX" path. I guess the culprit to be located here. |
That turns out to be the case:
So where does that leave us? I think what we want is to detect a diff --git a/runtime/path_convert/src/main.cpp b/runtime/path_convert/src/main.cpp
index 87900b2..6b2ceb1 100644
--- a/runtime/path_convert/src/main.cpp
+++ b/runtime/path_convert/src/main.cpp
@@ -34,7 +34,8 @@ typedef struct test_data_t {
#endif
static const test_data datas[] = {
- {"/usr/lib:/var:", MSYSROOT "\\usr\\lib;" MSYSROOT "\\var;", false}
+ {"string(settings/servers/server[id = \"gitlab\"]/configuration/httpHeaders/property/name)", "string(settings/servers/server[id = \"gitlab\"]/configuration/httpHeaders/property/name)", false}
+ ,{"/usr/lib:/var:", MSYSROOT "\\usr\\lib;" MSYSROOT "\\var;", false}
,{"-LIBPATH:../lib", "-LIBPATH:../lib", false}
,{"-LIBPATH:../lib:/var", "-LIBPATH:..\\lib;" MSYSROOT "\\var", false}
,{"//Collection:http://tfsserver", "//Collection:http://tfsserver", false}
diff --git a/runtime/path_convert/src/path_conv.cpp b/runtime/path_convert/src/path_conv.cpp
index f072533..0aa151b 100644
--- a/runtime/path_convert/src/path_conv.cpp
+++ b/runtime/path_convert/src/path_conv.cpp
@@ -195,6 +195,10 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
if (*it == '\0' || it == end) return NONE;
while (!isalnum(*it) && *it != '/' && *it != '\\' && *it != ':' && *it != '-' && *it != '.') {
+ if (*it == '=' && (it + 1 == end || isspace(it[1]))) {
+ *src = end;
+ return NONE;
+ }
recurse = true;
it = ++*src;
if (it == end || *it == '\0') return NONE;
@@ -287,6 +291,10 @@ path_type find_path_start_and_type(const char** src, int recurse, const char* en
starts_with_minus = false;
if ((ch == '=') || (ch == ':' && starts_with_minus) || ((ch == '\'' || ch == '"') && result == NONE)) {
*src = it2 + 1;
+ if (*src == end || isspace(it2[1])) {
+ *src = end;
+ return NONE;
+ }
return find_path_start_and_type(src, true, end);
}
What do you think, @lazka? |
Cygwin is less intrusive in the path translation:
Of course I tried to reproduce the error (by inserting the
|
(I'm a bit busy right now, I'll have a look next week. Thanks for the detailed investigation) |
After #143, my xmllint command has broken:
(msys2-runtime 3.4.6-2)
because the space in the argument somehow means that the path conversion behaviour is triggered for the next part of the argument, despite the whole thing being quoted.
I've managed to reduce it to a minimal example below:
It's not quite clear from #143 whether this was intentional or not, certainly the behaviour is a little strange. If so, what's the correct work around? I suppose I could set
MSYS2_ARG_CONV_EXCL=*
for just that command, but that feels hacky at best. Is there something more permanent I can set in my environment that will work for "all" commands?The text was updated successfully, but these errors were encountered: