Remove now unnecessary `gitno_unescape`
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/src/netops.c b/src/netops.c
index 26cb607..c74faff 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -206,24 +206,6 @@ void gitno_connection_data_free_ptrs(gitno_connection_data *d)
git__free(d->pass); d->pass = NULL;
}
-#define hex2c(c) ((c | 32) % 39 - 9)
-char* gitno_unescape(char *str)
-{
- int x, y;
- int len = (int)strlen(str);
-
- for (x=y=0; str[y]; ++x, ++y) {
- if ((str[x] = str[y]) == '%') {
- if (y < len-2 && isxdigit(str[y+1]) && isxdigit(str[y+2])) {
- str[x] = (hex2c(str[y+1]) << 4) + hex2c(str[y+2]);
- y += 2;
- }
- }
- }
- str[x] = '\0';
- return str;
-}
-
int gitno_extract_url_parts(
char **host_out,
char **port_out,
diff --git a/src/netops.h b/src/netops.h
index ed1cc86..75fd9a5 100644
--- a/src/netops.h
+++ b/src/netops.h
@@ -96,6 +96,4 @@ int gitno_extract_url_parts(
const char *url,
const char *default_port);
-char* gitno_unescape(char *str);
-
#endif