Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7566

Groovysh command arguments parser does not handle escaped blanks

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0, 2.4.4
    • Fix Version/s: 2.5.0-alpha-1
    • Component/s: Groovysh
    • Labels:
      None

      Description

      To reproduce:

      groovy:000> import org.codehaus.groovy.tools.shell.util.CommandArgumentParser 
      ===> org.codehaus.groovy.tools.shell.util.CommandArgumentParser
      groovy:000> CommandArgumentParser.parseLine('foo \\"')
      Missing closing " in foo \" -- [foo, \]
      // should single argument escaped hyphen
      
      groovy:000> CommandArgumentParser.parseLine('\'\\\\ \\\' bar\'')
      ===> [\ ' bar]
      
      // should be single (quoted) argument [\\ \' bar]
      
      

      See https://github.com/apache/incubator-groovy/pull/92

        Attachments

          Activity

            People

            • Assignee:
              pascalschumacher Pascal Schumacher
              Reporter:
              tkruse Thibault Kruse
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: