aboutsummaryrefslogtreecommitdiff
path: root/src/capi.c
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2009-01-28 08:51:05 -0300
committercorvid <corvid@lavabit.com>2009-01-28 08:51:05 -0300
commitfa21fc6b615f4b199edae837e8cc2561998f017b (patch)
treeb29cdf4c7895cea5f22b4a2de2f257c9a68b0b4a /src/capi.c
parente1c1007084bf29111b7fa909ee962ba2f2b56f40 (diff)
Added a warning message when a file can't be opened for saving
Diffstat (limited to 'src/capi.c')
-rw-r--r--src/capi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/capi.c b/src/capi.c
index 41df8de6..c92d16be 100644
--- a/src/capi.c
+++ b/src/capi.c
@@ -315,8 +315,12 @@ int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
/* download request: if cached save from cache, else
* for http, ftp or https, use the downloads dpi */
if (a_Capi_get_flags(web->url) & CAPI_IsCached) {
- if (web->filename && (web->stream = fopen(web->filename, "w"))) {
- use_cache = 1;
+ if (web->filename) {
+ if ((web->stream = fopen(web->filename, "w"))) {
+ use_cache = 1;
+ } else {
+ MSG_WARN("Cannot open \"%s\" for writing.\n", web->filename);
+ }
}
} else {
if (!dStrcasecmp(scheme, "https") ||