Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-11-05 22:37:50 +0400
committerBen Straub <bs@github.com>2013-11-05 22:37:50 +0400
commitfe294b95d1f04ceb4d279b312d3f88375dbe0dc9 (patch)
treeb2f93ce8e4f0087f37e32fedfb942130a2de1a27 /src/netops.c
parentac72051afa619446818adf286cf3cdbd13991b38 (diff)
Incorporate feedback
Diffstat (limited to 'src/netops.c')
-rw-r--r--src/netops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/netops.c b/src/netops.c
index 72172f39b..1a0d102d7 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -703,24 +703,24 @@ int gitno_extract_url_parts(
_path = url+u.field_data[UF_PATH].off;
_userinfo = url+u.field_data[UF_USERINFO].off;
- if (u.field_data[UF_HOST].len) {
+ if (u.field_set & (1 << UF_HOST)) {
*host = git__substrdup(_host, u.field_data[UF_HOST].len);
GITERR_CHECK_ALLOC(*host);
}
- if (u.field_data[UF_PORT].len)
+ if (u.field_set & (1 << UF_PORT))
*port = git__substrdup(_port, u.field_data[UF_PORT].len);
else
*port = git__strdup(default_port);
GITERR_CHECK_ALLOC(*port);
- if (u.field_data[UF_PATH].len) {
+ if (u.field_set & (1 << UF_PATH)) {
*path = git__substrdup(_path, u.field_data[UF_PATH].len);
GITERR_CHECK_ALLOC(*path);
}
- if (u.field_data[UF_USERINFO].len) {
- const char *colon = strchr(_userinfo, ':');
+ if (u.field_set & (1 << UF_USERINFO)) {
+ const char *colon = memchr(_userinfo, ':', u.field_data[UF_USERINFO].len);
if (colon && (colon - _userinfo) < u.field_data[UF_USERINFO].len) {
*username = unescape(git__substrdup(_userinfo, colon - _userinfo));
*password = unescape(git__substrdup(colon+1, u.field_data[UF_USERINFO].len - (colon+1-_userinfo)));