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

Groovysh command arguments parser does not handle escaped blanks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.0, 2.4.4
    • 2.5.0-alpha-1
    • Groovysh
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: