--- lib/file.c	2007-06-04 17:30:02.000000000 +0800
+++ file.c	2007-06-04 17:29:38.000000000 +0800
@@ -393,7 +393,12 @@
   }
 
   if (fstated && (expected_size == 0)){
-    return  CURLE_OK;
+    buf[0] = '\0';
+    res = data->set.fwrite( buf, 1, 0, data->set.out );
+    if(!res)
+      return  CURLE_OK;
+    else
+      return  CURLE_WRITE_ERROR;
   }
   /* The following is a shortcut implementation of file reading
      this is both more efficient than the former call to download() and
