convert: quote filter names in error messages

Git filter driver commands with spaces (e.g. `filter.sh foo`) are hard to read in error messages. Quote them to improve the readability. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Lars Schneider committed Oct 16, 2016 at 16:20 UTC 255f04d604dbb331933c2354b5d15ed6715e7d6a
1 file changed +6 -6
convert.c
+6 -6
@@ -412,7 +412,7 @@ static int filter_buffer_or_fd(int in, int out, void *data)
412 child_process.out = out;
413
414 if (start_command(&child_process))
415 - return error("cannot fork to run external filter %s", params->cmd);
415 + return error("cannot fork to run external filter '%s'", params->cmd);
416
417 sigchain_push(SIGPIPE, SIG_IGN);
418
@@ -430,13 +430,13 @@ static int filter_buffer_or_fd(int in, int out, void *data)
430 if (close(child_process.in))
431 write_err = 1;
432 if (write_err)
433 - error("cannot feed the input to external filter %s", params->cmd);
433 + error("cannot feed the input to external filter '%s'", params->cmd);
434
435 sigchain_pop(SIGPIPE);
436
437 status = finish_command(&child_process);
438 if (status)
439 - error("external filter %s failed %d", params->cmd, status);
439 + error("external filter '%s' failed %d", params->cmd, status);
440
441 strbuf_release(&cmd);
442 return (write_err || status);
@@ -477,15 +477,15 @@ static int apply_filter(const char *path, const char *src, size_t len, int fd,
477 return 0; /* error was already reported */
478
479 if (strbuf_read(&nbuf, async.out, len) < 0) {
480 - error("read from external filter %s failed", cmd);
480 + error("read from external filter '%s' failed", cmd);
481 ret = 0;
482 }
483 if (close(async.out)) {
484 - error("read from external filter %s failed", cmd);
484 + error("read from external filter '%s' failed", cmd);
485 ret = 0;
486 }
487 if (finish_async(&async)) {
488 - error("external filter %s failed", cmd);
488 + error("external filter '%s' failed", cmd);
489 ret = 0;
490 }
491