From: pixdamix Date: Mon, 11 Jan 2010 09:51:32 +0000 (+0000) Subject: Fail if cache_dir is specified and not a directory X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=33a5092e4160f4d1577b6e11a18bd0cae253ddad;p=oweals%2Fopkg-lede.git Fail if cache_dir is specified and not a directory git-svn-id: http://opkg.googlecode.com/svn/trunk@514 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c index cfbf351..c852d86 100644 --- a/libopkg/opkg_download.c +++ b/libopkg/opkg_download.c @@ -199,6 +199,13 @@ opkg_download_cache(const char *src, const char *dest_file_name, goto out1; } + if(!file_is_dir(conf->cache)){ + opkg_msg(ERROR, "%s is not a directory.\n", + conf->cache); + err = 1; + goto out1; + } + for (p = cache_name; *p; p++) if (*p == '/') *p = ','; /* looks nicer than | or # */