quote.c: separate quoting and relative path generation

This is in preparation of relative path support for ls-files, which
quotes a path only if the line terminator is not the NUL character.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Clemens Buchacher
2010-06-03 15:36:31 +02:00
committed by Junio C Hamano
parent c8b296450e
commit b167cffb6b
2 changed files with 68 additions and 32 deletions

View File

@@ -54,9 +54,12 @@ extern void quote_two_c_style(struct strbuf *, const char *, const char *, int);
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);
extern void write_name_quoted_relative(const char *name, size_t len,
const char *prefix, size_t prefix_len,
FILE *fp, int terminator);
/* quote path as relative to the given prefix */
char *quote_path_relative(const char *in, int len,
extern char *quote_path_relative(const char *in, int len,
struct strbuf *out, const char *prefix);
/* quoting as a string literal for other languages */