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

$EXEC: double quotes are no longer correctly handled

    XMLWordPrintable

Details

    • x86
    • windows_8

    Description

      FULL PRODUCT VERSION :
      java version "1.9.0-ea"
      Java(TM) SE Runtime Environment (build 1.9.0-ea-b91)
      Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b91, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.10240]

      A DESCRIPTION OF THE PROBLEM :
      An $EXEC command which contains double quotes, no longer works as expected. This is the case, both for escaped double quotes, and unescaped double quotes inside a single-quote string.

      REGRESSION. Last worked in version 8u45

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      create a file test.js with the following content:
      $EXEC("find \"host\"", "host"); // use escaped double quotes
      print($OUT);
      print($ERR);

      $EXEC('find "host"', "host"); // use single quotes
      print($OUT);
      print($ERR);

      and run it with the command on a Windows host (since the command uses the Windows-specific "find" tool):
      jjs -scripting test.js

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Output is:
      host

      host

      ACTUAL -
      Output is:
      FIND: Parameter format not correct

      FIND: Parameter format not correct


      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Activity

          People

            mhaupt Michael Haupt
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: