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>
Junio C Hamano committed
Oct 30, 2006 at 16:07 UTC
8d63d95f297446fe110ea76d350ae15676e2ed54
1 file changed
+1
-1
quote.c
+1
-1
@@ -209,7 +209,7 @@ static int quote_c_style_counted(const char *name, int namelen,
209
if (!ch)
210
break;
211
if ((ch < ' ') || (ch == '"') || (ch == '\\') ||
212
- (ch == 0177)) {
212
+ (ch >= 0177)) {
213
needquote = 1;
214
switch (ch) {
215
case '\a': EMITQ(); ch = 'a'; break;