From 6bfda18041dffeac373ad799b22b0aceaaf6039d Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sat, 28 May 2016 09:40:08 +0000 Subject: fuck if I know. I'm tired. moved the magic stuff to url.c. --- matchurl.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'matchurl.c') diff --git a/matchurl.c b/matchurl.c index 396f829..9be390f 100644 --- a/matchurl.c +++ b/matchurl.c @@ -7,6 +7,7 @@ int main(int argc,char *argv[]) { int i; + int ret=1; struct url u; char *line=malloc(LINE_LENGTH); char copy[LINE_LENGTH]; @@ -28,24 +29,25 @@ int main(int argc,char *argv[]) { for(i=1;i= strlen(argv[i+1]) && !strncmp(u.domain+strlen(u.domain)-strlen(argv[i+1]),argv[i+1],strlen(argv[i+1]))) printf("%s\n",copy); + ret=0; break; default: printf("unknown url part letter! '%c'\n",argv[i][0]); - return 0; + return ret; } } } - return 0; + return ret; } -- cgit v1.2.3