Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-23687

Invalid command line parsing at QCoreApplication::arguments on MS Windows family

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.7.1, 4.7.4, 4.8.0, 4.8.4, 5.0.0
    • Fix Version/s: 5.4.0
    • Component/s: Core: Other
    • Environment:
      1. MS Windows 7 Ultimate SP1 x86 Rus
      2. MS Visual Studio 2010 SP1
    • Commits:
      9b121e5579538477a1fc7c8250e5d7e875a58de8 (dev, 15.5.2014, 5.4)

      Description

      Invalid command line parsing at QCoreApplication::arguments on MS Windows family: double backslashes not recognized.
      Compare argc/argv passed to main with result of QCoreApplication::arguments when command line is:

      qtapp.exe arg1 "arg2" "\"arg3\"" "\\arg4\\" "\\\"arg5\\\""

      I found some rules of Windows command line parsing: http://www.autohotkey.net/~deleyd/parameters/parameters.htm#WINCRULES.
      Also I tried to make solution - see attached "QtCore_winmain_argv.patch" - but it's not complete.

      Try attached "qt_4_8_0_winmain_argv_bug.zip" (solution for MSVS 2010) in debug configuration to see bug (and try it after applying "QtCore_winmain_argv.patch" - bug will still be there).

        Attachments

        1. args.zip
          1 kB
        2. cli_args_bug.patch
          16 kB
        3. qt_4_8_0_winmain_argv_bug.zip
          5 kB
        4. QtCore_winmain_argv.patch
          0.6 kB

          Issue Links

          For Gerrit Dashboard: QTBUG-23687
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              mabrarov Marat Abrarov
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes