X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=quote.c;h=1910d000a5d288734aaea24da617481223ff9f56;hb=6ece0d3030ae2dc5b49fcfcc83df4966a52e0d0b;hp=7218a7080d9a4282530b58c013606c86e4a5fdf5;hpb=9086a18cb81f99fff943b36830396ac8c37c7e9f;p=git.git diff --git a/quote.c b/quote.c index 7218a7080..1910d000a 100644 --- a/quote.c +++ b/quote.c @@ -13,7 +13,7 @@ * a!b ==> a'\!'b ==> 'a'\!'b' */ #undef EMIT -#define EMIT(x) ( (++len < n) && (*bp++ = (x)) ) +#define EMIT(x) do { if (++len < n) *bp++ = (x); } while(0) static inline int need_bs_quote(char c) { @@ -144,8 +144,6 @@ static int quote_c_style_counted(const char *name, int namelen, case '\\': /* fallthru */ case '"': EMITQ(); break; - case ' ': - break; default: /* octal */ EMITQ(); @@ -208,7 +206,14 @@ char *unquote_c_style(const char *quoted, const char **endp) case '\\': case '"': break; /* verbatim */ - case '0'...'7': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': /* octal */ ac = ((ch - '0') << 6); if ((ch = *sp++) < '0' || '7' < ch)