diff -urN curl-7.26.0-orig/lib/sendf.c curl-7.26.0-jh/lib/sendf.c
--- curl-7.26.0-orig/lib/sendf.c	2012-03-08 20:35:25.000000000 +0100
+++ curl-7.26.0-jh/lib/sendf.c	2012-07-05 18:21:57.284367439 +0200
@@ -452,7 +452,7 @@
     }
     /* If the previous block of data ended with CR and this block of data is
        just a NL, then the length might be zero */
-    if(len) {
+    if(len && (data->set.out != NULL || set.is_fwrite_set)) {
       wrote = data->set.fwrite_func(ptr, 1, len, data->set.out);
     }
     else {

