Index: main/org/apache/tools/ant/taskdefs/Replace.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
retrieving revision 1.5
diff -u -r1.5 Replace.java
--- main/org/apache/tools/ant/taskdefs/Replace.java	2000/09/11 10:45:16	1.5
+++ main/org/apache/tools/ant/taskdefs/Replace.java	2000/09/16 17:48:51
@@ -95,6 +95,10 @@
             throw new BuildException("replace token must not be null", location);
         }
 
+        if (token.getText().equals("")) {
+            throw new BuildException("replace token must not be empty", location);
+        }
+
         if (src == null && dir == null) {
             throw new BuildException("Either the file or the dir attribute must be specified", location);
         }
@@ -124,6 +128,10 @@
      * @param src the source file
      */
     private void processFile(File src) throws BuildException {
+        if (!src.exists()) { 
+            throw new BuildException("Replace: source file " + src.getPath() + " doesn't exist", location);
+        }
+
         File temp = new File(src.getPath() + ".temp");
 
         if (temp.exists()) {
