pgoldstein    2002/09/25 18:44:35

  Modified:    src/java/org/apache/james/util SqlResources.java
  Log:
  Fix for bug #12855.  substituteSubString fails on multiple replaces.
  
  
  Revision  Changes    Path
  1.5       +2 -2      jakarta-james/src/java/org/apache/james/util/SqlResources.java
  
  Index: SqlResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/util/SqlResources.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SqlResources.java 16 Aug 2002 21:06:32 -0000      1.4
  +++ SqlResources.java 26 Sep 2002 01:44:35 -0000      1.5
  @@ -237,9 +237,9 @@
   
           while ( index > -1 ) {
               output.replace(index + outputOffset, index + outputOffset + 
find_length, replace);
  -            outputOffset = outputOffset - find_length + replace_length;
  +            outputOffset = outputOffset + (replace_length - find_length);
   
  -            index = input.indexOf(find, index + replace_length);
  +            index = input.indexOf(find, index + find_length);
           }
   
           String result = output.toString();
  
  
  

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

Reply via email to