X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=http-fetch.c;fp=http-fetch.c;h=3a2cb5e1fc1b2794f632c5ddbedfa99500081e5a;hb=d90149c5b4e91938329120bdde609e5f6d9b03e8;hp=da1a7f5416a4bf3a633d3577382984f528694a78;hpb=ae448e3854d8b6e7e37aa88fa3917f5dd97f3210;p=git.git diff --git a/http-fetch.c b/http-fetch.c index da1a7f54..3a2cb5e1 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -1136,13 +1136,14 @@ int fetch(unsigned char *sha1) static inline int needs_quote(int ch) { - switch (ch) { - case '/': case '-': case '.': - case 'A'...'Z': case 'a'...'z': case '0'...'9': + if (((ch >= 'A') && (ch <= 'Z')) + || ((ch >= 'a') && (ch <= 'z')) + || ((ch >= '0') && (ch <= '9')) + || (ch == '/') + || (ch == '-') + || (ch == '.')) return 0; - default: - return 1; - } + return 1; } static inline int hex(int v)