summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorMatthias Lederhofer <matled@gmx.net>2006-06-25 13:56:18 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-07-09 07:57:23 (GMT)
commit575ba9d69d5dfd07d95343fe946a5991c4cb27d6 (patch)
tree8f9f3ca832249b98c3621a09035baba2e1ce385f /quote.c
parent88f0d5d7d95f815d2e8a36a8ceb7459dbd90992c (diff)
downloadgit-575ba9d69d5dfd07d95343fe946a5991c4cb27d6.zip
git-575ba9d69d5dfd07d95343fe946a5991c4cb27d6.tar.gz
git-575ba9d69d5dfd07d95343fe946a5991c4cb27d6.tar.bz2
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 <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/quote.c b/quote.c
index 1910d00..e220dcc 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;