summaryrefslogtreecommitdiff
path: root/libfetch/fetch.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-10-05 13:47:36 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-10-05 16:59:14 +0300
commit531fea4c9082d6542c776dcb6d4ca0a3949ecdd0 (patch)
tree5d7d5ccb6d78c415cc4422569d9f88f0b1cf8bd1 /libfetch/fetch.c
parentf6860e0e110a82fe61ce46de4fb5a05794e456ab (diff)
downloadapk-tools-531fea4c9082d6542c776dcb6d4ca0a3949ecdd0.tar.gz
apk-tools-531fea4c9082d6542c776dcb6d4ca0a3949ecdd0.tar.bz2
apk-tools-531fea4c9082d6542c776dcb6d4ca0a3949ecdd0.tar.xz
apk-tools-531fea4c9082d6542c776dcb6d4ca0a3949ecdd0.zip
libfetch: remove unwanted code conditionals
Diffstat (limited to 'libfetch/fetch.c')
-rw-r--r--libfetch/fetch.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/libfetch/fetch.c b/libfetch/fetch.c
index 78cec71..4abf56f 100644
--- a/libfetch/fetch.c
+++ b/libfetch/fetch.c
@@ -30,10 +30,6 @@
* $FreeBSD: fetch.c,v 1.41 2007/12/19 00:26:36 des Exp $
*/
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
@@ -446,18 +442,17 @@ find_user:
}
/* hostname */
-#ifdef INET6
if (*p == '[' && (q = strchr(p + 1, ']')) != NULL &&
(*++q == '\0' || *q == '/' || *q == ':')) {
if ((i = q - p - 2) > URL_HOSTLEN)
i = URL_HOSTLEN;
strncpy(u->host, ++p, i);
p = q;
- } else
-#endif
+ } else {
for (i = 0; *p && (*p != '/') && (*p != ':'); p++)
if (i < URL_HOSTLEN)
u->host[i++] = *p;
+ }
/* port */
if (*p == ':') {