quote.c: ensure the same quoting across platforms.
We read a byte from "char *" and compared it with ' ' to decide if it needs quoting to protect textual output. With a platform where char is unsigned char that would give different result. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
4903161fb8
commit
8d63d95f29
2
quote.c
2
quote.c
@ -209,7 +209,7 @@ static int quote_c_style_counted(const char *name, int namelen,
|
|||||||
if (!ch)
|
if (!ch)
|
||||||
break;
|
break;
|
||||||
if ((ch < ' ') || (ch == '"') || (ch == '\\') ||
|
if ((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;
|
||||||
|
Loading…
Reference in New Issue
Block a user