Hi! We use subprocess.h in llama.cpp to launch MCP servers, and we hit this on Windows.
When an argument contains a space and ends with a backslash, like a folder path such as C:\my dir, the child process receives it merged with everything that comes after it, as one single argument with a stray quote in the middle.
What happens: the argument gets wrapped in quotes because of the space, but the trailing backslash is left alone, so it ends up escaping the closing quote. From the child's point of view the quote never closes.
Screenshot below shows the same call before and after a local fix, on a Windows machine.
I can open a PR with a proposed fix and a test case if you want.
Patch: ggml-org/llama.cpp@86b7a53

Hi! We use subprocess.h in llama.cpp to launch MCP servers, and we hit this on Windows.
When an argument contains a space and ends with a backslash, like a folder path such as C:\my dir, the child process receives it merged with everything that comes after it, as one single argument with a stray quote in the middle.
What happens: the argument gets wrapped in quotes because of the space, but the trailing backslash is left alone, so it ends up escaping the closing quote. From the child's point of view the quote never closes.
Screenshot below shows the same call before and after a local fix, on a Windows machine.
I can open a PR with a proposed fix and a test case if you want.
Patch: ggml-org/llama.cpp@86b7a53