juergen     01/03/05 02:09:03

  Modified:    src/webdav/client/src/org/apache/webdav/cmd Slide.java
  Log:
  added a cast from byte to char.
  
  Revision  Changes    Path
  1.3       +41 -41    
jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java
  
  Index: Slide.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Slide.java        2001/03/01 22:02:55     1.2
  +++ Slide.java        2001/03/05 10:09:01     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v 1.2 
2001/03/01 22:02:55 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/03/01 22:02:55 $
  + * $Header: 
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/cmd/Slide.java,v 1.3 
2001/03/05 10:09:01 juergen Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/03/05 10:09:01 $
    *
    * ====================================================================
    *
  @@ -406,7 +406,7 @@
                           }
                       }
                       for (int o = 1; o < options.length; o++) {
  -                        switch (options[o]) {
  +                        switch ((char)options[o]) {
                           case 'l':
                               try {
                                   Vector list = webdavResource.listCollection();
  @@ -912,44 +912,44 @@
   
           String normalized = path;
   
  -     // Normalize the slashes and add leading slash if necessary
  -     if (normalized.indexOf('\\') >= 0)
  -         normalized = normalized.replace('\\', '/');
  -     if (!normalized.startsWith("/"))
  -         normalized = "/" + normalized;
  -
  -     // Resolve occurrences of "/./" in the normalized path
  -     while (true) {
  -         int index = normalized.indexOf("/./");
  -         if (index < 0)
  -             break;
  -         normalized = normalized.substring(0, index) +
  -             normalized.substring(index + 2);
  -     }
  -
  -     // Resolve occurrences of "/../" in the normalized path
  -     while (true) {
  -         int index = normalized.indexOf("/../");
  -         if (index < 0)
  -             break;
  -         if (index == 0)
  -             return (null);  // Trying to go outside our context
  -         int index2 = normalized.lastIndexOf('/', index - 1);
  -         normalized = normalized.substring(0, index2) +
  -             normalized.substring(index + 3);
  -     }
  -
  -     // Resolve occurrences of "//" in the normalized path
  -     while (true) {
  -         int index = normalized.indexOf("//");
  -         if (index < 0)
  -             break;
  -         normalized = normalized.substring(0, index) +
  -             normalized.substring(index + 1);
  -     }
  +        // Normalize the slashes and add leading slash if necessary
  +        if (normalized.indexOf('\\') >= 0)
  +            normalized = normalized.replace('\\', '/');
  +        if (!normalized.startsWith("/"))
  +            normalized = "/" + normalized;
  +
  +        // Resolve occurrences of "/./" in the normalized path
  +        while (true) {
  +            int index = normalized.indexOf("/./");
  +            if (index < 0)
  +            break;
  +            normalized = normalized.substring(0, index) +
  +            normalized.substring(index + 2);
  +        }
  +
  +        // Resolve occurrences of "/../" in the normalized path
  +        while (true) {
  +            int index = normalized.indexOf("/../");
  +            if (index < 0)
  +            break;
  +            if (index == 0)
  +            return (null);  // Trying to go outside our context
  +            int index2 = normalized.lastIndexOf('/', index - 1);
  +            normalized = normalized.substring(0, index2) +
  +            normalized.substring(index + 3);
  +        }
  +
  +        // Resolve occurrences of "//" in the normalized path
  +        while (true) {
  +            int index = normalized.indexOf("//");
  +            if (index < 0)
  +            break;
  +            normalized = normalized.substring(0, index) +
  +            normalized.substring(index + 1);
  +        }
   
  -     // Return the normalized path that we have completed
  -     return (normalized);
  +        // Return the normalized path that we have completed
  +        return (normalized);
       }
   
   
  
  
  

Reply via email to