mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
fix riscos mkpath and error reporting in save complete
This commit is contained in:
parent
0a2082d777
commit
966ed9449c
@ -37,6 +37,7 @@
|
|||||||
#include "utils/utf8.h"
|
#include "utils/utf8.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include "utils/file.h"
|
#include "utils/file.h"
|
||||||
|
#include "utils/messages.h"
|
||||||
#include "content/content.h"
|
#include "content/content.h"
|
||||||
#include "content/hlcache.h"
|
#include "content/hlcache.h"
|
||||||
#include "css/css.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);
|
ret = netsurf_mkpath(&fname, NULL, 2, ctx->path, leafname);
|
||||||
if (ret != NSERROR_OK) {
|
if (ret != NSERROR_OK) {
|
||||||
warn_user("NoMemory", 0);
|
warn_user(messages_get_errorcode(ret), 0);
|
||||||
return false;
|
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);
|
ret = netsurf_mkpath(&fname, NULL, 2, ctx->path, filename);
|
||||||
if (ret != NSERROR_OK) {
|
if (ret != NSERROR_OK) {
|
||||||
warn_user("NoMemory", NULL);
|
warn_user(messages_get_errorcode(ret), NULL);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,8 +1198,9 @@ bool save_complete(hlcache_handle *c, const char *path,
|
|||||||
|
|
||||||
result = save_complete_save_html(&ctx, c, true);
|
result = save_complete_save_html(&ctx, c, true);
|
||||||
|
|
||||||
if (result)
|
if (result) {
|
||||||
result = save_complete_inventory(&ctx);
|
result = save_complete_inventory(&ctx);
|
||||||
|
}
|
||||||
|
|
||||||
save_complete_ctx_finalise(&ctx);
|
save_complete_ctx_finalise(&ctx);
|
||||||
|
|
||||||
|
@ -2360,8 +2360,8 @@ static nserror riscos_mkpath(char **str, size_t *size, size_t nelm, va_list ap)
|
|||||||
curp = fname;
|
curp = fname;
|
||||||
|
|
||||||
/* first element is not altered */
|
/* first element is not altered */
|
||||||
memmove(curp, elm[elm_idx], elm_len[elm_idx]);
|
memmove(curp, elm[0], elm_len[0]);
|
||||||
curp += elm_len[elm_idx];
|
curp += elm_len[0];
|
||||||
/* ensure there is a delimiter */
|
/* ensure there is a delimiter */
|
||||||
if (curp[-1] != DIR_SEP) {
|
if (curp[-1] != DIR_SEP) {
|
||||||
*curp = DIR_SEP;
|
*curp = DIR_SEP;
|
||||||
|
Loading…
Reference in New Issue
Block a user