#1439 Buggy parsing of command line parameters

OTHER
closed
nobody
None
invalid
Behaves_as_Documented
2013-01-21
2010-06-04
Anonymous
No

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.

Discussion

  • Earnie Boyd

    Earnie Boyd - 2010-06-04
    • milestone: --> Behaves_as_Documented
    • status: open --> closed-invalid
     
  • Earnie Boyd

    Earnie Boyd - 2010-06-04

    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.

     
  • Earnie Boyd

    Earnie Boyd - 2013-01-21
    • labels: MinGW -->
    • status: closed-invalid --> closed
    • resolution: --> invalid
    • category: --> Behaves_as_Documented
    • milestone: Behaves_as_Documented --> OTHER
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks