Update draft release notes for 1.5.4.5
[gitweb.git] / builtin-fast-export.c
index 2136aadfd7831828ee29fbfa9ae7974c65271dee..724cff35d37a42daa85edd41b97f0ef20d01f684 100755 (executable)
@@ -103,7 +103,7 @@ static void handle_object(const unsigned char *sha1)
        mark_object(object);
 
        printf("blob\nmark :%d\ndata %lu\n", last_idnum, size);
-       if (fwrite(buf, size, 1, stdout) != 1)
+       if (size && fwrite(buf, size, 1, stdout) != 1)
                die ("Could not write blob %s", sha1_to_hex(sha1));
        printf("\n");
 
@@ -123,7 +123,7 @@ static void show_filemodify(struct diff_queue_struct *q,
                        printf("D %s\n", spec->path);
                else {
                        struct object *object = lookup_object(spec->sha1);
-                       printf("M 0%06o :%d %s\n", spec->mode,
+                       printf("M %06o :%d %s\n", spec->mode,
                               get_object_mark(object), spec->path);
                }
        }