Commit 05551ca091bed2aa1f557b848c7602d036961bd3

Edward Thomson 2018-03-03T20:14:54

Remove now unnecessary `gitno_unescape`

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