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

Windows: Leading backslash stripped from command line arguments starting with \\ (network share paths)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P0: Blocker
    • 5.2.0
    • 5.2.0 RC1
    • Core: Other
    • None
    • Windows 8.1
    • 7cfe7c198224babeb06eac583e419bbd82c7217e (release branch , 6.12.2013)

    Description

      Using the attached example, pass a network share path as arguments:

      d:\dev\projects\cmdargs_5>release\cmdargs.exe \\server\path
      5.2.1
      0 release\cmdargs.exe
      1 \\server\path
      ("release\cmdargs.exe", "\server\path")
      

      whereas in Qt 4:

      d:\dev\projects\cmdargs_4>release\cmdargs.exe \\server\path
      4.8.6
      0 release\cmdargs.exe
      1 \\server\path
      ("release\cmdargs.exe", "\\server\path")
      

      "
      " is changed to "\" in the debug output of QCoreApplication::arguments(). It seems to perform some backslash-escaping which it clearly shouldn't. Quoting in double-quotes does not help (note it is possible for example to start

      explorer \\server\path
      

      , so, the Windows shell clearly does not do backslash-escaping). This is pretty serious as you cannot pass cmd line arguments of that type to any application.

      Attachments

        1. qtbug35432.zip
          7 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes