Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 77983 invoked from network); 11 Jun 2009 17:31:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jun 2009 17:31:20 -0000 Received: (qmail 50862 invoked by uid 500); 11 Jun 2009 17:31:31 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 50753 invoked by uid 500); 11 Jun 2009 17:31:31 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 50741 invoked by uid 99); 11 Jun 2009 17:31:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jun 2009 17:31:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jun 2009 17:31:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 55FD4234C046 for ; Thu, 11 Jun 2009 10:31:07 -0700 (PDT) Message-ID: <2019063843.1244741467350.JavaMail.jira@brutus> Date: Thu, 11 Jun 2009 10:31:07 -0700 (PDT) From: "Emmanuel Bourg (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (CLI-185) Commons CLI incorrectly stripping leading and trailing quotes In-Reply-To: <1305584945.1244638567563.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLI-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718566#action_12718566 ] Emmanuel Bourg commented on CLI-185: ------------------------------------ Even on Windows the quotes aren't passed to the application. I don't understand why John Keyes had to remove quotes in CLI-22. > Commons CLI incorrectly stripping leading and trailing quotes > ------------------------------------------------------------- > > Key: CLI-185 > URL: https://issues.apache.org/jira/browse/CLI-185 > Project: Commons CLI > Issue Type: Bug > Components: Parser > Affects Versions: 1.1, 1.2 > Environment: Darwin dator 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386 > GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0) > and > Linux build-einarmr 2.6.9-023stab048.4-smp #1 SMP Fri Jul 11 18:50:44 MSD 2008 x86_64 x86_64 x86_64 GNU/Linux > GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu) > Reporter: Einar M R Rosenvinge > Fix For: 1.3 > > > org.apache.commons.cli.Parser.processArgs() calls Util.stripLeadingAndTrailingQuotes() for all argument values. IMHO this is incorrect and totally broken. > It is trivial to create a simple test for this. Output: > $ java -cp target/clitest.jar Clitest --balloo "this is a \"test\"" > Value of argument balloo is 'this is a "test'. > The argument 'balloo' should indeed keep its trailing double quote. It is what the shell gives it, so don't try to do something clever to it. > The offending code was committed here: > http://svn.apache.org/viewvc?view=rev&revision=129874 > and has been there for more than 6 years (!). Why was this committed in the first place? > The fix is trivial, just get rid of Util.stripLeadingAndTrailingQuotes(), and consequently avoid calling it from Parser.processArgs(). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.