You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2002/02/07 19:39:01 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/util URI.java
sandygao 02/02/07 10:39:01
Modified: java/src/org/apache/xerces/util URI.java
Log:
Fixing bug [6258]: we didn't handle /../../ correctly.
Revision Changes Path
1.5 +4 -3 xml-xerces/java/src/org/apache/xerces/util/URI.java
Index: URI.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/URI.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- URI.java 29 Jan 2002 01:15:18 -0000 1.4
+++ URI.java 7 Feb 2002 18:39:01 -0000 1.5
@@ -88,7 +88,7 @@
* default port for a specific scheme). Rather, it only knows the
* grammar and basic set of operations that can be applied to a URI.
*
-* @version $Id: URI.java,v 1.4 2002/01/29 01:15:18 lehors Exp $
+* @version $Id: URI.java,v 1.5 2002/02/07 18:39:01 sandygao Exp $
*
**********************************************************************/
public class URI implements Serializable {
@@ -518,8 +518,9 @@
tempString = path.substring(0, path.indexOf("/../"));
segIndex = tempString.lastIndexOf('/');
if (segIndex != -1) {
- if (!tempString.substring(segIndex++).equals("..")) {
- path = path.substring(0, segIndex).concat(path.substring(index+4));
+ if (!tempString.substring(segIndex).equals("..")) {
+ path = path.substring(0, segIndex+1).concat(path.substring(index+4));
+ index = segIndex;
}
else
index += 4;
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org