ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Heindl <andreashei...@gmx.de>
Subject [patch] Bug with spaces in file names in ApacheURLLister.java
Date Sat, 30 Mar 2013 08:48:00 GMT
Hello,

there is a bug in
apache-ivy-2.3.0-src.zip/apache-ivy-2.3.0/src/java/org/apache/ivy/util/url/ApacheURLLister.java

When parsing an file containing spaces, its href representation is 
encoded, whilst the text is unencoded. The check in line 177:

String strippedHref = href_dec.endsWith("/") ? href_dec.substring(0, 
href_dec.length() - 1) : href_dec;
String strippedText = text.endsWith("/") ? text.substring(0, 
text.length() - 1) : text;
if (!strippedHref.equalsIgnoreCase(strippedText)) {
     continue;

therefore is not successful.

Example:
href=bla%20und%20bub.dat
text=bla und bub.dat


Suggested patch is an Uri.decode(href):


String href_dec = Uri.decode(href);
String strippedHref = href_dec.endsWith("/") ? href_dec.substring(0, 
href_dec.length() - 1) : href_dec;
String strippedText = text.endsWith("/") ? text.substring(0, 
text.length() - 1) : text;
if (!strippedHref.equalsIgnoreCase(strippedText)) {
     continue;




Greetings,
  Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message