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: [email protected]
Reporter: [email protected]
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="<link rel="e;icon"e; type="e;image/png"e;
size="e;48x48"e; href="e;path/to/my/favion.png"e; />"/>
</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.