From 4c586bc85ccb0f8b7a4aeaded7eb54e6198e4a80 Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Tue, 10 Jan 2006 14:55:26 +0000 Subject: [PATCH] Better handling of URLs when CURL is not installed git-svn: trunk@1809 --- clamav-devel/libclamav/mbox.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/clamav-devel/libclamav/mbox.c b/clamav-devel/libclamav/mbox.c index c7e8fe220..09ecf07b7 100644 --- a/clamav-devel/libclamav/mbox.c +++ b/clamav-devel/libclamav/mbox.c @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char const rcsid[] = "$Id: mbox.c,v 1.272 2006/01/05 12:42:39 nigelhorne Exp $"; +static char const rcsid[] = "$Id: mbox.c,v 1.273 2006/01/10 14:55:26 nigelhorne Exp $"; #if HAVE_CONFIG_H #include "clamav-config.h" @@ -934,7 +934,11 @@ cli_parse_mbox(const char *dir, int desc, unsigned int options) int tmpfd; #endif +#ifdef NEW_WORLD + cli_dbgmsg("fall back to old world\n"); +#else cli_dbgmsg("in mbox()\n"); +#endif i = dup(desc); if((fd = fdopen(i, "rb")) == NULL) { @@ -3818,18 +3822,12 @@ checkURLs(message *m, const char *dir) */ len = sizeof(cmd) - 26 - strlen(dir) - strlen(name); #ifdef CL_DEBUG - snprintf(cmd, sizeof(cmd) - 1, "GET -t10 %.*s >%s/%s", len, url, dir, name); + snprintf(cmd, sizeof(cmd) - 1, "GET -t10 \"%.*s\" >%s/%s", len, url, dir, name); #else - snprintf(cmd, sizeof(cmd) - 1, "GET -t10 %.*s >%s/%s 2>/dev/null", len, url, dir, name); + snprintf(cmd, sizeof(cmd) - 1, "GET -t10 \"%.*s\" >%s/%s 2>/dev/null", len, url, dir, name); #endif cmd[sizeof(cmd) - 1] = '\0'; -#ifndef WITH_CURL - for(ptr = cmd; *ptr; ptr++) - if(strchr(";&", *ptr)) - *ptr = '_'; -#endif - cli_dbgmsg("%s\n", cmd); #ifdef CL_THREAD_SAFE pthread_mutex_lock(&system_mutex);