[jdee-users] Proposed patch to build.xml for MSWindows double-quote escape-char (msw-dqec)
Brought to you by:
paullandes
From: Vincent B. <vin...@ho...> - 2013-02-21 05:59:12
|
Hello, Please find attached a patch proposal for jdee/build.xml. The problem at stake is that which I reported to Ant as: http://issues.apache.org/bugzilla/show_bug.cgi?id=54285 My understanding of the problem is the following one: - MSDos command line has arcane and poorly documented rules for escaping special characters: - inside double quote the escape char is \ and you need to escape " and \, however most of the time not escaping \ will work because a single \ is interpreted as \ also - percent sign have to be double quoted as ^%, but outside of the double-quotes - example: a\string%to\\be quoted %% now would be double-quoted as: "a\\string"^%"to\\\\be quoted "^%^%" now" - Ant does not do anything special to quote properly arguments passed to command. This means that any double quote in the argument will cause havoc - is that a bug of Ant or of the JVM: - my understanding that that is a little of both - the standard Java library should provide some support to process a string into a quoted string for the platform on which the program is run, like File.separator depends on the platform on which the program is run --- to my knowledge there is no such support - Ant should call such standard library function --- if it was existing to do the argument quoting properly - the hack which I propose is to do the escaping by hand within the build.xml. Of course as soon as Ant is corrected for this problem, then build.xml will need further patching so that property msw-dqec is set to empty string when Ant version is recent enough. VBR, Vincent. |