Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4110242

(process) Runtime.exec(String cmd) can not parse legal command line

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      The current Runtime.exec(String cmd) uses wrong parser for command line. For
      example. If given the comamnd line is exactly as below.
      child.exe "a b"
      Note there are two spaces between a and b. This command line will be parsed
      into args like
      argv[0] = "child.exe";
      argv[1] = "\"a";
      argv[2] = "b\"";

      When these arguments are catenated together, what we got it
      child "a b"
      now, we have only one space between a and b. But there is only one space between
      a and b in the orignal command line, we will lucky to get back the original one.

      If it is on unix, we are totally screwed up. The child process will get 3
      arguements instead of 2.

      Attachments

        Issue Links

          Activity

            People

              martin Martin Buchholz
              hongzh Hong Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: