Skip to content

Commit

Permalink
quote.c: ensure the same quoting across platforms.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Oct 31, 2006
1 parent 4903161 commit 8d63d95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quote.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static int quote_c_style_counted(const char *name, int namelen,
if (!ch)
break;
if ((ch < ' ') || (ch == '"') || (ch == '\\') ||
(ch == 0177)) {
(ch >= 0177)) {
needquote = 1;
switch (ch) {
case '\a': EMITQ(); ch = 'a'; break;
Expand Down

0 comments on commit 8d63d95

Please sign in to comment.