[Xfce4-commits] [apps/ristretto] 01/01: Fix loading image from an URL
noreply at xfce.org
noreply at xfce.org
Sun Feb 5 18:29:53 CET 2017
This is an automated email from the git hooks/post-receive script.
f2404 pushed a commit to branch master
in repository apps/ristretto.
commit dc632fd6669222a93dae45d039f33b537c78ac99
Author: Igor <f2404 at yandex.ru>
Date: Sun Feb 5 20:29:48 2017 +0300
Fix loading image from an URL
---
src/file.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/file.c b/src/file.c
index d915340..00a19bd 100644
--- a/src/file.c
+++ b/src/file.c
@@ -398,20 +398,24 @@ rstto_file_get_collate_key ( RsttoFile *r_file )
const gchar *
rstto_file_get_content_type ( RsttoFile *r_file )
{
- const gchar *content_type = NULL;
+ const gchar *file_path, *content_type = NULL;
if ( NULL == r_file->priv->content_type )
{
#if HAVE_MAGIC_H
- magic_t magic = magic_open(MAGIC_MIME_TYPE);
+ magic_t magic = magic_open (MAGIC_MIME_TYPE);
if ( magic != NULL )
{
- if ( magic_load(magic, NULL) == 0 )
+ if ( magic_load (magic, NULL) == 0 )
{
- content_type = magic_file(magic, rstto_file_get_path(r_file));
- if ( NULL != content_type )
+ file_path = rstto_file_get_path (r_file);
+ if ( file_path != NULL )
{
- r_file->priv->content_type = g_strdup (content_type);
+ content_type = magic_file (magic, file_path);
+ if ( NULL != content_type )
+ {
+ r_file->priv->content_type = g_strdup (content_type);
+ }
}
}
magic_close(magic);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list