Merge commit 'sg/merge-options^' into jk/renamelimit
[gitweb.git] / combine-diff.c
index 7d710334ffa9ce4fa82145f4b1745d048635c475..f1e7a4d5d98f8705b6a1a7a420dccc9ecad69d63 100644 (file)
@@ -656,16 +656,7 @@ static void dump_quoted_path(const char *head,
        strbuf_reset(&buf);
        strbuf_addstr(&buf, c_meta);
        strbuf_addstr(&buf, head);
-       if (quote_c_style(prefix, NULL, NULL, 0) ||
-           quote_c_style(path, NULL, NULL, 0)) {
-               strbuf_addch(&buf, '"');
-               quote_c_style(prefix, &buf, NULL, 1);
-               quote_c_style(path, &buf, NULL, 1);
-               strbuf_addch(&buf, '"');
-       } else {
-               strbuf_addstr(&buf, prefix);
-               strbuf_addstr(&buf, path);
-       }
+       quote_two_c_style(&buf, prefix, path, 0);
        strbuf_addstr(&buf, c_reset);
        puts(buf.buf);
 }
@@ -727,9 +718,9 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
                        result = xmalloc(len + 1);
                        while (sz < len) {
                                ssize_t done = xread(fd, result+sz, len-sz);
-                               if (done == 0)
-                                       break;
-                               if (done < 0)
+                               if (done == 0 && sz != len)
+                                       die("early EOF '%s'", elem->path);
+                               else if (done < 0)
                                        die("read error '%s'", elem->path);
                                sz += done;
                        }