[Xfce4-commits] [apps/ristretto] 01/01: Simplify the code

noreply at xfce.org noreply at xfce.org
Sun Feb 5 18:40:50 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 6cc891de661ead1359ac83bda22e4de880185b47
Author: Igor <f2404 at yandex.ru>
Date:   Sun Feb 5 20:40:45 2017 +0300

    Simplify the code
---
 src/file.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/file.c b/src/file.c
index 00a19bd..fd2ff19 100644
--- a/src/file.c
+++ b/src/file.c
@@ -404,21 +404,18 @@ rstto_file_get_content_type ( RsttoFile *r_file )
     {
 #if HAVE_MAGIC_H
         magic_t magic = magic_open (MAGIC_MIME_TYPE);
-        if ( magic != NULL )
+        if ( NULL != magic )
         {
-            if ( magic_load (magic, NULL) == 0 )
+            file_path = rstto_file_get_path (r_file);
+            if ( NULL != file_path && magic_load (magic, NULL) == 0 )
             {
-                file_path = rstto_file_get_path (r_file);
-                if ( file_path != NULL )
+                content_type = magic_file (magic, file_path);
+                if ( NULL != content_type )
                 {
-                    content_type = magic_file (magic, file_path);
-                    if ( NULL != content_type )
-                    {
-                        r_file->priv->content_type = g_strdup (content_type);
-                    }
+                    r_file->priv->content_type = g_strdup (content_type);
                 }
             }
-            magic_close(magic);
+            magic_close (magic);
         }
 #endif
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list