tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util FileUtil.java
Date Sun, 05 Nov 2000 05:28:53 GMT
craigmcc    00/11/04 21:28:53

  Modified:    src/share/org/apache/tomcat/util Tag: tomcat_32
                        FileUtil.java
  Log:
  Update pathname parsing to deal with multiple '\' characters on NetWare
  platforms.
  
  Submitted by: Mike Anderson <MMANDERS@novell.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.5   +15 -7     jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java
  
  Index: FileUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java,v
  retrieving revision 1.9.2.4
  retrieving revision 1.9.2.5
  diff -u -r1.9.2.4 -r1.9.2.5
  --- FileUtil.java	2000/10/11 00:24:45	1.9.2.4
  +++ FileUtil.java	2000/11/05 05:28:53	1.9.2.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java,v 1.9.2.4
2000/10/11 00:24:45 arieh Exp $
  - * $Revision: 1.9.2.4 $
  - * $Date: 2000/10/11 00:24:45 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/FileUtil.java,v 1.9.2.5
2000/11/05 05:28:53 craigmcc Exp $
  + * $Revision: 1.9.2.5 $
  + * $Date: 2000/11/05 05:28:53 $
    *
    * ====================================================================
    *
  @@ -267,12 +267,20 @@
   	    patchPath = sb.toString();
   	}
   
  -	// fix path on NetWare
  +	// fix path on NetWare - all '/' become '\\' and remove duplicate '\\'
   	if (System.getProperty("os.name").startsWith("NetWare") &&
   	    path.length() >=3 &&
  -	    path.indexOf(':') > 0)
  -	    patchPath = patchPath.replace('/', '\\');
  -
  +	    path.indexOf(':') > 0) {
  +            char ca[] = patchPath.replace('/', '\\').toCharArray();
  +            StringBuffer sb = new StringBuffer();
  +            for (int i = 0; i < ca.length; i++) {
  +                if ((ca[i] != '\\') ||
  +                    (ca[i] == '\\' && i > 0 && ca[i-1] != '\\')) {
  +                    sb.append(ca[i]);
  +                }
  +            }
  +            patchPath = sb.toString();
  +        }
   	return patchPath;
       }
   
  
  
  

Mime
View raw message