summaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-07-12 23:09:10 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-07-12 23:09:10 -0700
commitd3ba675aae3c6c5722ad15cd9d0f3b7634e976ce (patch)
tree94813d10e42424a31cd58ad8eb9f338874cd0d7d /quote.c
parentgit-repack: avoid redirecting stderr into git-pack-objects (diff)
parenttest-lib: unset GIT_TRACE (diff)
downloadtgif-d3ba675aae3c6c5722ad15cd9d0f3b7634e976ce.tar.xz
Merge branch 'ml/trace'
* ml/trace: test-lib: unset GIT_TRACE GIT_TRACE: fix a mixed declarations and code warning GIT_TRACE: show which built-in/external commands are executed
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 1910d000a5..e220dcc280 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;