summaryrefslogtreecommitdiff
path: root/quote.h
diff options
context:
space:
mode:
authorDmitry Potapov <dpotapov@gmail.com>2008-03-07 05:30:58 +0300
committerJunio C Hamano <gitster@pobox.com>2008-03-07 21:22:25 -0800
commita734d0b10bd0f5554abb3acdf11426040cfc4df0 (patch)
treec5a2aa55520903d376121336f00679bc0780529c /quote.h
parent79418599e7221ef10641cf9cc07018c25b4d0310 (diff)
downloadgit-a734d0b10bd0f5554abb3acdf11426040cfc4df0.tar.gz
Make private quote_path() in wt-status.c available as quote_path_relative()
Move quote_path() from wt-status.c to quote.c and rename it as quote_path_relative(), because it is a better name for a public function. Also, instead of handcrafted quoting, quote_c_style_counted() is now used, to make its quoting more consistent with the rest of the system, also honoring core.quotepath specified in configuration. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'quote.h')
-rw-r--r--quote.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/quote.h b/quote.h
index 4da110ec01..c5eea6f18e 100644
--- a/quote.h
+++ b/quote.h
@@ -47,6 +47,10 @@ extern void write_name_quoted(const char *name, FILE *, int terminator);
extern void write_name_quotedpfx(const char *pfx, size_t pfxlen,
const char *name, FILE *, int terminator);
+/* quote path as relative to the given prefix */
+char *quote_path_relative(const char *in, int len,
+ struct strbuf *out, const char *prefix);
+
/* quoting as a string literal for other languages */
extern void perl_quote_print(FILE *stream, const char *src);
extern void python_quote_print(FILE *stream, const char *src);