billbarker    2002/06/15 19:56:13

  Modified:    catalina/src/share/org/apache/catalina/util Tag:
                        tomcat_40_branch URL.java
  Log:
  Port from HEAD branch.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +11 -7     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java
  
  Index: URL.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- URL.java  5 Sep 2001 17:31:11 -0000       1.2
  +++ URL.java  16 Jun 2002 02:56:13 -0000      1.2.2.1
  @@ -698,7 +698,11 @@
                   start = limit;
               }
               if (authority.length() > 0) {
  -                int colon = authority.indexOf(':');
  +                int at = authority.indexOf('@');
  +                if( at >= 0 ) {
  +                    userInfo = authority.substring(0,at);
  +                }
  +                int colon = authority.indexOf(':', at+1);
                   if (colon >= 0) {
                       try {
                           port =
  @@ -706,9 +710,9 @@
                       } catch (NumberFormatException e) {
                           throw new MalformedURLException(e.toString());
                       }
  -                    host = authority.substring(0, colon);
  +                    host = authority.substring(at+1, colon);
                   } else {
  -                    host = authority;
  +                    host = authority.substring(at+1);
                       port = -1;
                   }
               }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to