ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10499] - Compiler task doesn't handle spaces in filenames correctly
Date Tue, 03 Jun 2003 14:47:36 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10499>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10499

Compiler task doesn't handle spaces in filenames correctly

joe.boon@cdcsolutions.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |



------- Additional Comments From joe.boon@cdcsolutions.com  2003-06-03 14:47 -------
I am re-opening this bug. Based on the fix I have seen for it in a recent 1.6 
alpha nightly build it is not the correct fix.

I was hoping it would make 1.5, but it seems to have missed the last 1.5 build 
(1.5.3).

Here is the 'fix' in the 1.6 nightly build:

                    for (int i = firstFileName; i < args.length; i  ) {
                        if (quoteFiles && args[i].indexOf(" ") > -1) {
                            out.println("\""   args[i]   "\"");
                        } else {
                            out.println(args[i]);
                        }
                    }

This is not a complete fix. There are three problems with this fix:

1. It needs to escape backslashes, see bug 17683. Without doing this it will 
not work, especially on Windows which always uses backslashes.

2. The method decides whether to quote the names using the "quoteFiles" 
boolean parameter. However, there is no way of setting quoteFiles to True. 

There is no way of configuring Ant to do this. When used in Tomcat this will 
not be set. It would be great to always set this to True if running on 
Windows. At the moment, swapping ant.jar from the latest Ant 1.6 nightly-build 
into Tomcat 4.1.24 (which uses Ant 1.5.1), and restarting Tomcat does not fix 
the problem. The fix needs to work automatically.

3. The fix checks whether there is space before quoting the file. If someone 
wants to quote the file, why not always quote them. There might be other 
characters in the filename that need quoting (other white space). If it is 
going to check for spaces, then why do we need quoteFiles? Why not always 
quote files with spaces in their names?

I would be grateful if the fix could be re-done. At the moment the default 
install of Tomcat on Windows doesn't work for small to medium sized 
applications.

Mime
View raw message