Do not quote SP.

Follow the "encode minimally" principle -- our tools, including
git-apply and git-status, can handle pathnames with embedded SP just
fine.  The only problematic ones are TAB and LF, and we need to quote
the metacharacters introduced for quoting.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2005-10-17 13:34:42 -07:00
parent b71d01ef3c
commit 25785195ee

View File

@ -75,8 +75,8 @@ int quote_c_style(const char *name, char *outbuf, FILE *outfp, int no_dq)
EMIT('"'); EMIT('"');
for (sp = name; (ch = *sp++); ) { for (sp = name; (ch = *sp++); ) {
if ((ch <= ' ') || (ch == '"') || if ((ch < ' ') || (ch == '"') || (ch == '\\') ||
(ch == '\\') || (ch == 0177)) { (ch == 0177)) {
needquote = 1; needquote = 1;
switch (ch) { switch (ch) {
case '\a': EMITQ(); ch = 'a'; break; case '\a': EMITQ(); ch = 'a'; break;