aboutsummaryrefslogtreecommitdiff
path: root/quote.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-03 22:14:40 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-03 23:05:34 -0800
commitd77ee72662a821d66ae218056f0103eb24d8d4b4 (patch)
treee22abdbd11735a0669362f934ae723d233c87e2b /quote.c
parenteb8381c88518b10d683a29deea1d43ed671f14ec (diff)
parent8d0fc48f27304ac1bc7abf802ec53fe66fedb15a (diff)
downloadgit-d77ee72662a821d66ae218056f0103eb24d8d4b4.tar.gz
git-d77ee72662a821d66ae218056f0103eb24d8d4b4.tar.xz
Merge branch 'master' into np/dreflog
This is to resolve conflicts early in preparation for possible inclusion of "reflog on detached HEAD" series by Nico, as having it in 1.5.0 would really help us remove confusion between detached and attached states. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'quote.c')
-rw-r--r--quote.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/quote.c b/quote.c
index a418a0f80..fb9e4ca25 100644
--- a/quote.c
+++ b/quote.c
@@ -387,3 +387,37 @@ void python_quote_print(FILE *stream, const char *src)
}
fputc(sq, stream);
}
+
+void tcl_quote_print(FILE *stream, const char *src)
+{
+ char c;
+
+ fputc('"', stream);
+ while ((c = *src++)) {
+ switch (c) {
+ case '[': case ']':
+ case '{': case '}':
+ case '$': case '\\': case '"':
+ fputc('\\', stream);
+ default:
+ fputc(c, stream);
+ break;
+ case '\f':
+ fputs("\\f", stream);
+ break;
+ case '\r':
+ fputs("\\r", stream);
+ break;
+ case '\n':
+ fputs("\\n", stream);
+ break;
+ case '\t':
+ fputs("\\t", stream);
+ break;
+ case '\v':
+ fputs("\\v", stream);
+ break;
+ }
+ }
+ fputc('"', stream);
+}