if (!(module=captivemodid_module_md5_lookup(file_md5)))
goto fail_free_file_md5;
- if (strcmp("cabinet",module->type))
+ if (strcmp("cabinet",(const char *)module->type))
mod_uri_load_module_from_memory(module,file_base,file_length,uri);
else {
struct acquire_cabinet *acquire_cabinet;
if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_open_uri(&handle,uri,GNOME_VFS_OPEN_READ)))
goto fail;
+ CAPTIVE_MEMZERO(&file_info_local);
if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_from_handle(handle,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT)))
goto fail_close_handle;
if (file_info_local.type!=GNOME_VFS_FILE_TYPE_REGULAR) {
errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
- goto fail_close_handle;
+ goto fail_file_info_local_clear;
}
if (!(file_info_local.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE)) {
errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
- goto fail_close_handle;
+ goto fail_file_info_local_clear;
}
if (!captivemodid_module_length_is_valid(file_info_local.size)) {
errvfsresult=GNOME_VFS_ERROR_WRONG_FORMAT;
- goto fail_close_handle;
+ goto fail_file_info_local_clear;
}
if (file_info_local.size<=MAX_FILE_LOAD_LENGTH)
mod_uri_load_file_handle_to_memory(handle,&file_info_local,uri);
}
errvfsresult=GNOME_VFS_OK;
/* PASSTHRU */
+fail_file_info_local_clear:
+ gnome_vfs_file_info_clear(&file_info_local);
fail_close_handle:
gnome_vfs_close(handle);
fail:;
}
}
-void mod_uri_load(GnomeVFSURI *uri)
+static void mod_uri_load_internal(GnomeVFSURI *uri,gboolean base_reporting)
{
GnomeVFSFileInfo file_info_local;
GnomeVFSResult errvfsresult;
g_free(uri_text);
}
+ CAPTIVE_MEMZERO(&file_info_local);
file_info_local.type=GNOME_VFS_FILE_TYPE_UNKNOWN;
- if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_uri(uri,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT)))
- return /* errvfsresult */;
+ if (GNOME_VFS_OK!=(errvfsresult=gnome_vfs_get_file_info_uri(uri,&file_info_local,GNOME_VFS_FILE_INFO_DEFAULT))) {
+ if (base_reporting) {
+gchar *uri_text;
+
+ uri_text=gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_PASSWORD);
+ g_warning(_("Error loading \"%s\": %s"),uri_text,gnome_vfs_result_to_string(errvfsresult));
+ g_free(uri_text);
+ }
+ return;
+ }
switch (file_info_local.type) {
- case GNOME_VFS_FILE_TYPE_REGULAR: return mod_uri_load_file(uri);
- case GNOME_VFS_FILE_TYPE_DIRECTORY: return mod_uri_load_directory(uri);
- default: return /* GNOME_VFS_ERROR_WRONG_FORMAT */;
+ case GNOME_VFS_FILE_TYPE_REGULAR: mod_uri_load_file(uri);
+ case GNOME_VFS_FILE_TYPE_DIRECTORY: mod_uri_load_directory(uri);
+ default: /* GNOME_VFS_ERROR_WRONG_FORMAT */;
}
- /* NOTREACHED */
+ gnome_vfs_file_info_clear(&file_info_local);
+}
+
+void mod_uri_load(GnomeVFSURI *uri)
+{
+ g_return_if_fail(uri!=NULL);
+
+ mod_uri_load_internal(uri,
+ FALSE); /* base_reporting */
+}
+
+void mod_uri_load_base_reporting(GnomeVFSURI *uri)
+{
+ g_return_if_fail(uri!=NULL);
+
+ mod_uri_load_internal(uri,
+ TRUE); /* base_reporting */
}