]> git.ipfire.org Git - thirdparty/git.git/blobdiff - quote.c
Allow INSTALL, bindir, mandir to be set in main Makefile
[thirdparty/git.git] / quote.c
diff --git a/quote.c b/quote.c
index 7218a7080d9a4282530b58c013606c86e4a5fdf5..1910d000a5d288734aaea24da617481223ff9f56 100644 (file)
--- 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)