Index: CmsSetupDb.java
===================================================================
RCS file: /usr/local/cvs/opencms/src/com/opencms/boot/CmsSetupDb.java,v
retrieving revision 1.1
diff -u -r1.1 CmsSetupDb.java
--- CmsSetupDb.java	2001/11/12 12:55:21	1.1
+++ CmsSetupDb.java	2002/03/01 18:03:34
@@ -149,27 +149,39 @@
         }
     }
 
-  private String replaceValues(String source, Hashtable replacers)  {
-    StringTokenizer tokenizer = new StringTokenizer(source);
-    String temp = "";
+  private String replaceValues(String source, Map replacers)  {
+    int pos=0, tokenpos, endtokenpos;
+    StringBuffer ret = new StringBuffer();
 
-    while(tokenizer.hasMoreTokens())  {
-      String token = tokenizer.nextToken();
-
-      // replace identifier found
-      if(token.startsWith("$$") && token.endsWith("$$"))  {
-
-        // look in the hashtable
-        Object value = replacers.get(token);
-
-        //found value
-        if(value != null) {
-            token = value.toString();
-        }
+    while(Character.isWhitespace(source.charAt(pos)))
+    	pos++;
+    while(true)  {
+      tokenpos=source.indexOf("$$",pos);
+      if(tokenpos==-1)  {
+        ret.append(source.substring(pos));
+        break;
       }
-      temp += token + " ";
+      endtokenpos=source.indexOf("$$",tokenpos+2);
+      if(endtokenpos==-1)  {
+        ret.append(source.substring(pos));
+        break;
+      }
+      String token=source.substring(tokenpos,endtokenpos+2);
+      String newvalue=(String)replacers.get(token);
+      if(newvalue==null)  {
+        ret.append(source.substring(pos));
+        break;
+      }
+      ret.append(source.substring(pos,tokenpos));
+      ret.append(newvalue);
+      pos=endtokenpos+2;
+    }
+    int l=ret.length()-1;
+    while(l>=0 && Character.isWhitespace(ret.charAt(l)))  {
+      ret.deleteCharAt(l);
+      l--;
     }
-    return temp;
+    return ret.toString();
   }
 
   private String getScript(String key) {
