Index: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
retrieving revision 1.51
diff -u -r1.51 Jar.java
--- jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java	15 Apr 2002 15:33:08 -0000	1.51
+++ jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java	21 May 2002 20:31:16 -0000
@@ -103,6 +103,8 @@
      */
     private boolean mergeManifests = false;
 
+    boolean manifestOnFinalize = true;
+
     /**
      * whether to merge the main section of fileset manifests;
      * value is true if filesetmanifest is 'merge'
@@ -223,8 +225,15 @@
     protected void initZipOutputStream(ZipOutputStream zOut)
         throws IOException, BuildException {
-        String ls = System.getProperty("line.separator");
+        if (! (mergeManifests || mergeManifestsMain)) {
+            manifestOnFinalize = false;
+            createManifest(zOut);
+        }
+    }
 
+    private void createManifest(ZipOutputStream zOut) throws IOException
+    {
+        String ls = System.getProperty("line.separator");
         try {
             Manifest finalManifest = Manifest.getDefaultManifest();
@@ -284,6 +293,10 @@ 
     protected void finalizeZipOutputStream(ZipOutputStream zOut)
             throws IOException, BuildException {
+        if (manifestOnFinalize) {
+            createManifest(zOut);
+        }
+
         if (index) {
             createIndexList(zOut);
         }

