diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-12-30 04:37:22 -0600 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-12-30 04:37:22 -0600 |
commit | 1db8f7d916874f22c15df3121e3ec5ba5f7e7310 (patch) | |
tree | 128be6565fb3b598cc6828e85876f19fe7196234 /cuturl.c | |
parent | 4f05827c8b10d07cd9bc04424922a4dba4f728ab (diff) | |
download | uritools-1db8f7d916874f22c15df3121e3ec5ba5f7e7310.tar.gz uritools-1db8f7d916874f22c15df3121e3ec5ba5f7e7310.zip |
enabled magic by default in cuturl.
made cuturl print empty string instead of trying to print nulls.
matchurl was matching multiple times for things it shouldn't have and not cleaing out the url struct.
Makefile now uses -Wall
Diffstat (limited to 'cuturl.c')
-rw-r--r-- | cuturl.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -8,6 +8,8 @@ #include "url.h" +#define MAGIC + /* schemes are case sensitive but cononicals are lower case. domain is case insensitive. return it lowercased? @@ -161,14 +163,14 @@ int main(int argc,char *argv[]) { } else { if(c) { for(i=0;i<c;i++) { - if(args[i]&F_SCHEME) printf("%s\n",u.scheme); - if(args[i]&F_USERNAME) printf("%s\n",u.username); - if(args[i]&F_PASSWORD) printf("%s\n",u.password); - if(args[i]&F_DOMAIN) printf("%s\n",u.domain); - if(args[i]&F_PORT) printf("%s\n",u.port); - if(args[i]&F_PATH) printf("%s\n",u.path); - if(args[i]&F_QUERY_STRING) printf("%s\n",u.query_string); - if(args[i]&F_FRAGMENT_ID) printf("%s\n",u.fragment_id); + if(args[i]&F_SCHEME) printf("%s\n",AorB(u.scheme,"")); + if(args[i]&F_USERNAME) printf("%s\n",AorB(u.username,"")); + if(args[i]&F_PASSWORD) printf("%s\n",AorB(u.password,"")); + if(args[i]&F_DOMAIN) printf("%s\n",AorB(u.domain,"")); + if(args[i]&F_PORT) printf("%s\n",AorB(u.port,"")); + if(args[i]&F_PATH) printf("%s\n",AorB(u.path,"")); + if(args[i]&F_QUERY_STRING) printf("%s\n",AorB(u.query_string,"")); + if(args[i]&F_FRAGMENT_ID) printf("%s\n",AorB(u.fragment_id,"")); } } else { printf("scheme: %s\n",u.scheme); |