I'm trying to write windows console application working with directories, and i
discover that arguments processed not right. For example:
#include <iostream>
int main ( int argc, char *argv[], char *envp[] ) {
std::cout << "you have " << argc << " arguments";
}
resulting:
>a.exe "a a"
you have 2 arguments
>a.exe "a a" a
you have 3 arguments
>a.exe "a a\" a
you have 2 arguments
As i understand, backslash is escaping double quote and we have [a a" a]
argument instead of [a a\],[a].
It's very sad, because i must operate with directories or UNC paths like:
"\\serv\share\some dir with spaces\" where double quotes is required and
backslash can be present.
This is an "OS Feature" there is nothing MinGW can do. You must live within the documented behavior. See MSDN for more information on how to manage arguments and paths with spaces.