Skip to content

Commit 8a2cdbd

Browse files
emmax86ethomson
authored andcommitted
Rename unescape and make non-static
1 parent 3198577 commit 8a2cdbd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/netops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void gitno_connection_data_free_ptrs(gitno_connection_data *d)
207207
}
208208

209209
#define hex2c(c) ((c | 32) % 39 - 9)
210-
static char* unescape(char *str)
210+
char* gitno_unescape(char *str)
211211
{
212212
int x, y;
213213
int len = (int)strlen(str);
@@ -274,8 +274,8 @@ int gitno_extract_url_parts(
274274
if (u.field_set & (1 << UF_USERINFO)) {
275275
const char *colon = memchr(_userinfo, ':', u.field_data[UF_USERINFO].len);
276276
if (colon) {
277-
*username = unescape(git__substrdup(_userinfo, colon - _userinfo));
278-
*password = unescape(git__substrdup(colon+1, u.field_data[UF_USERINFO].len - (colon+1-_userinfo)));
277+
*username = gitno_unescape(git__substrdup(_userinfo, colon - _userinfo));
278+
*password = gitno_unescape(git__substrdup(colon+1, u.field_data[UF_USERINFO].len - (colon+1-_userinfo)));
279279
GITERR_CHECK_ALLOC(*password);
280280
} else {
281281
*username = git__substrdup(_userinfo, u.field_data[UF_USERINFO].len);

src/netops.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,6 @@ int gitno_extract_url_parts(
9696
const char *url,
9797
const char *default_port);
9898

99+
char* gitno_unescape(char *str);
100+
99101
#endif

0 commit comments

Comments
 (0)