fix riscos mkpath and error reporting in save complete

This commit is contained in:
Vincent Sanders 2014-05-17 23:14:43 +01:00
parent 0a2082d777
commit 966ed9449c
2 changed files with 7 additions and 5 deletions

View File

@ -37,6 +37,7 @@
#include "utils/utf8.h"
#include "utils/utils.h"
#include "utils/file.h"
#include "utils/messages.h"
#include "content/content.h"
#include "content/hlcache.h"
#include "css/css.h"
@ -149,7 +150,7 @@ static bool save_complete_save_buffer(save_complete_ctx *ctx,
ret = netsurf_mkpath(&fname, NULL, 2, ctx->path, leafname);
if (ret != NSERROR_OK) {
warn_user("NoMemory", 0);
warn_user(messages_get_errorcode(ret), 0);
return false;
}
@ -1051,7 +1052,7 @@ static bool save_complete_save_html_document(save_complete_ctx *ctx,
ret = netsurf_mkpath(&fname, NULL, 2, ctx->path, filename);
if (ret != NSERROR_OK) {
warn_user("NoMemory", NULL);
warn_user(messages_get_errorcode(ret), NULL);
return false;
}
@ -1197,8 +1198,9 @@ bool save_complete(hlcache_handle *c, const char *path,
result = save_complete_save_html(&ctx, c, true);
if (result)
if (result) {
result = save_complete_inventory(&ctx);
}
save_complete_ctx_finalise(&ctx);

View File

@ -2360,8 +2360,8 @@ static nserror riscos_mkpath(char **str, size_t *size, size_t nelm, va_list ap)
curp = fname;
/* first element is not altered */
memmove(curp, elm[elm_idx], elm_len[elm_idx]);
curp += elm_len[elm_idx];
memmove(curp, elm[0], elm_len[0]);
curp += elm_len[0];
/* ensure there is a delimiter */
if (curp[-1] != DIR_SEP) {
*curp = DIR_SEP;