usability: don't ask questions if no reply is required
[gitweb.git] / url.c
diff --git a/url.c b/url.c
index 2d89ad190cfe1c57cd20194661329551ff229993..eaf4f07081eae122fbc38e05f60ee2f11a0c65a6 100644 (file)
--- a/url.c
+++ b/url.c
@@ -29,25 +29,6 @@ int is_url(const char *url)
        return (url[0] == ':' && url[1] == '/' && url[2] == '/');
 }
 
-static int url_decode_char(const char *q)
-{
-       int i;
-       unsigned char val = 0;
-       for (i = 0; i < 2; i++) {
-               unsigned char c = *q++;
-               val <<= 4;
-               if (c >= '0' && c <= '9')
-                       val += c - '0';
-               else if (c >= 'a' && c <= 'f')
-                       val += c - 'a' + 10;
-               else if (c >= 'A' && c <= 'F')
-                       val += c - 'A' + 10;
-               else
-                       return -1;
-       }
-       return val;
-}
-
 static char *url_decode_internal(const char **query, int len,
                                 const char *stop_at, struct strbuf *out,
                                 int decode_plus)
@@ -66,7 +47,7 @@ static char *url_decode_internal(const char **query, int len,
                }
 
                if (c == '%') {
-                       int val = url_decode_char(q + 1);
+                       int val = hex2chr(q + 1);
                        if (0 <= val) {
                                strbuf_addch(out, val);
                                q += 3;