From 9eb3efff78d311a386ce783224d5e7bd6b88a5b1 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 20 Jun 2006 22:58:36 +0000 Subject: Make filename_create_directory check if directory already exists Constify return of filename_request Make bitmap save code check for filename_request failure Update ro_gui_view_source to take account of constification svn path=/trunk/netsurf/; revision=2639 --- riscos/gui.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'riscos/gui.c') diff --git a/riscos/gui.c b/riscos/gui.c index b6f74f79b..925659265 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -2164,20 +2164,22 @@ void ro_gui_view_source(struct content *content) message.file_name[211] = '\0'; free(temp_name); } else { - /* We cannot release the requested filename until after it has finished - being used. As we can't easily find out when this is, we simply don't - bother releasing it and simply allow it to be re-used next time NetSurf - is started. The memory overhead from doing this is under 1 byte per - filename. */ - temp_name = filename_request(); - if (!temp_name) { + /* We cannot release the requested filename until after it + * has finished being used. As we can't easily find out when + * this is, we simply don't bother releasing it and simply + * allow it to be re-used next time NetSurf is started. The + * memory overhead from doing this is under 1 byte per + * filename. */ + const char *filename = filename_request(); + if (!filename) { warn_user("NoMemory", 0); return; } - snprintf(full_name, 256, "%s/%s", TEMP_FILENAME_PREFIX, temp_name); + snprintf(full_name, 256, "%s/%s", TEMP_FILENAME_PREFIX, + filename); full_name[255] = '\0'; - r = __riscosify(full_name, 0, __RISCOSIFY_NO_SUFFIX, message.file_name, - 212, 0); + r = __riscosify(full_name, 0, __RISCOSIFY_NO_SUFFIX, + message.file_name, 212, 0); if (r == 0) { LOG(("__riscosify failed")); return; @@ -2205,7 +2207,8 @@ void ro_gui_view_source(struct content *content) message.pos.y = 0; message.est_size = 0; message.file_type = 0xfff; - ro_message_send_message(wimp_USER_MESSAGE_RECORDED, (wimp_message*)&message, 0, + ro_message_send_message(wimp_USER_MESSAGE_RECORDED, + (wimp_message*)&message, 0, ro_gui_view_source_bounce); } -- cgit v1.2.3