From 575ba9d69d5dfd07d95343fe946a5991c4cb27d6 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Sun, 25 Jun 2006 15:56:18 +0200 Subject: GIT_TRACE: show which built-in/external commands are executed With the environment variable GIT_TRACE set git will show - alias expansion - built-in command execution - external command execution on stderr. Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- quote.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'quote.c') diff --git a/quote.c b/quote.c index 1910d000a..e220dcc28 100644 --- a/quote.c +++ b/quote.c @@ -45,6 +45,23 @@ size_t sq_quote_buf(char *dst, size_t n, const char *src) return len; } +void sq_quote_print(FILE *stream, const char *src) +{ + char c; + + fputc('\'', stream); + while ((c = *src++)) { + if (need_bs_quote(c)) { + fputs("'\\", stream); + fputc(c, stream); + fputc('\'', stream); + } else { + fputc(c, stream); + } + } + fputc('\'', stream); +} + char *sq_quote(const char *src) { char *buf; -- cgit v1.2.1