summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorFlorian Forster <octo@verplant.org>2006-06-18 15:18:03 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-19 04:19:09 (GMT)
commitcfd432e63d77478d913497a62827ed95c56dda73 (patch)
treeb211821af83ec2653f23c6ea3d71fd8bd0e69397 /http-push.c
parent64e86c57867593ba0ee77a7b0ff0eb8e9d4d8ed5 (diff)
downloadgit-cfd432e63d77478d913497a62827ed95c56dda73.zip
git-cfd432e63d77478d913497a62827ed95c56dda73.tar.gz
git-cfd432e63d77478d913497a62827ed95c56dda73.tar.bz2
Remove ranges from switch statements.
Though very nice and readable, the "case 'a'...'z':" construct is not ANSI C99 compliant. This patch unfolds the range in `quote.c' and substitutes the switch-statement with an if-statement in `http-fetch.c' and `http-push.c'. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/http-push.c b/http-push.c
index ba64f8f..aaf155c 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1077,13 +1077,14 @@ static int fetch_indices(void)
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)