Diff of /jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java
Parent Directory
| Revision Log
| Patch
--- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java 2005/06/03 13:04:54 179783
+++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/URI.java 2005/06/03 13:18:34 179784
@@ -1913,7 +1913,7 @@ public class URI implements Cloneable, C
boolean isStartedFromPath = false;
int atColon = tmp.indexOf(':');
int atSlash = tmp.indexOf('/');
- if (atColon < 0 || (atSlash >= 0 && atSlash < atColon)) {
+ if (atColon <= 0 || (atSlash >= 0 && atSlash < atColon)) {
isStartedFromPath = true;
}
@@ -1936,7 +1936,7 @@ public class URI implements Cloneable, C
* ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
* </pre></blockquote><p>
*/
- if (at < length && tmp.charAt(at) == ':') {
+ if (at > 0 && at < length && tmp.charAt(at) == ':') {
char[] target = tmp.substring(0, at).toLowerCase().toCharArray();
if (validate(target, scheme)) {
_scheme = target;