From: Frédéric Marchal Date: Fri, 22 Jan 2010 09:36:26 +0000 (+0000) Subject: Detect if the URL is just a hostname (in that case .com match the default download... X-Git-Tag: v2_2_7~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8947bb9be3cd5695f4bf6f82ba2581f83cf4a718;p=thirdparty%2Fsarg.git Detect if the URL is just a hostname (in that case .com match the default download list) --- diff --git a/download.c b/download.c index d990418..776f1e7 100644 --- a/download.c +++ b/download.c @@ -261,9 +261,11 @@ int is_download_suffix(const char *url) urllen=strlen(url)-1; if (urllen<=0) return(0); if (url[urllen] == '.') return(0); //reject a single trailing dot + for (i=0 ; i=urllen) return(0); // url is a hostname without any path or file to download for (i=0 ; i<=max_suffix && imax_suffix || i>=urllen) return(0); suffix=url+urllen-i+1;