summaryrefslogtreecommitdiff
path: root/uricut.c
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2019-04-22 23:33:09 -0500
committerepoch <epoch@hacking.allowed.org>2019-04-22 23:33:09 -0500
commit25c40a3f4c5447fc2224b1707b44a99b46515151 (patch)
tree8ed6d5157f6e48e40a61bd3d10a9e4f27e0be66d /uricut.c
parent75fa9480f82b0fab52c00c35e1641da265041dfa (diff)
downloaduritools-25c40a3f4c5447fc2224b1707b44a99b46515151.tar.gz
uritools-25c40a3f4c5447fc2224b1707b44a99b46515151.zip
only printing parts of the url that are actually defined now
Diffstat (limited to 'uricut.c')
-rw-r--r--uricut.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/uricut.c b/uricut.c
index cf143c0..41b1d17 100644
--- a/uricut.c
+++ b/uricut.c
@@ -137,14 +137,14 @@ int main(int argc,char *argv[]) {
if(args[i]&F_WHOLE_URI) printf("%s\n",uri);
}
} else {
- printf("scheme: %s\n",u.scheme);
- printf("username: %s\n",u.username);
- printf("password: %s\n",u.password);
- printf("domain: %s\n",u.domain);
- printf("port: %s\n",u.port);
- printf("path: %s\n",u.path);
- printf("query_string: %s\n",u.query_string);
- printf("fragment_id: %s\n",u.fragment_id);
+ if(u.scheme) printf("scheme: %s\n",u.scheme);
+ if(u.username) printf("username: %s\n",u.username);
+ if(u.password) printf("password: %s\n",u.password);
+ if(u.domain) printf("domain: %s\n",u.domain);
+ if(u.port) printf("port: %s\n",u.port);
+ if(u.path) printf("path: %s\n",u.path);
+ if(u.query_string) printf("query_string: %s\n",u.query_string);
+ if(u.fragment_id) printf("fragment_id: %s\n",u.fragment_id);
printf("whole_uri: %s\n",uri);
}
free(uri);//this is definitely malloc()d