Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 77125 invoked from network); 10 Jun 2009 13:08:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jun 2009 13:08:21 -0000 Received: (qmail 93545 invoked by uid 500); 10 Jun 2009 13:08:32 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 93449 invoked by uid 500); 10 Jun 2009 13:08:32 -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 93409 invoked by uid 99); 10 Jun 2009 13:08:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 13:08:32 +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; Wed, 10 Jun 2009 13:08:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 87DC7234C04C for ; Wed, 10 Jun 2009 06:08:07 -0700 (PDT) Message-ID: <31773787.1244639287555.JavaMail.jira@brutus> Date: Wed, 10 Jun 2009 06:08: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=12718062#action_12718062 ] Emmanuel Bourg commented on CLI-185: ------------------------------------ This was committed to fix CLI-22. I do agree that the quotes should not be removed. > 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: CLI-1.x > Affects Versions: 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 > > 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.