ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54285] New: Ant task exec arg value does not quote properly for MSWindows
Date Wed, 12 Dec 2012 19:24:56 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54285

            Bug ID: 54285
           Summary: Ant task exec arg value does not quote properly for
                    MSWindows
           Product: Ant
           Version: 1.8.0
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: vincent.b.1@hotmail.fr
    Classification: Unclassified

Created attachment 29747
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29747&action=edit
Java code proposal to escape properly double quotes for MSWindows

I want to pass to some application the following string:\\
{noformat}
<link rel="icon" type="image/png" size="48x48" href="path/to/my/favion.png" />
{noformat}

So I use the following:\\
{noformat} 
<exec executable="some_executable.exe">
<arg value="&lt;link rel=&quote;icon&quote; type=&quote;image/png&quote;
size=&quote;48x48&quote; href=&quote;path/to/my/favion.png&quote; /&gt;"/>
</exec>
{noformat}

However, the application gets this instead:\\
{noformat}
<link rel=icon type=image/png size=48x48 href=path/to/my/favion.png />
{noformat}

Double quotes were stripped by MSWindows because they were not properly escaped
in the command line by Ant.

I wrote a piece of code to do escaping of double quotes properly, and I
attached it to the issue. There are two implementation proposed for the double
quote escaping, on is based on regexps, and the other is plain character
processing --- probably more efficient, but maybe a little more obscure.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message