2006-08-23 [colin] 2.4.0cvs78
[claws.git] / src / mimeview.c
index d6b79c11b48bceaccc52946d4e9cec8b0462ab5f..3a3cff20eeee7a04710c7c179c81a18e8d035fab 100644 (file)
@@ -64,7 +64,7 @@
 #include "stock_pixmap.h"
 #include "gtk/gtkvscrollbutton.h"
 #include "gtk/logwindow.h"
-
+#include "timing.h"
 
 typedef enum
 {
@@ -1644,14 +1644,18 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
        }
        
        if ((partinfo->type == MIMETYPE_TEXT && !strcmp(partinfo->subtype, "html"))
-       && prefs_common.uri_cmd && prefs_common.uri_cmd[0])
+       && prefs_common.uri_cmd && prefs_common.uri_cmd[0]) {
                mime_command = g_strdup(prefs_common.uri_cmd);
-       else if (partinfo->type != MIMETYPE_TEXT || !prefs_common.ext_editor_cmd
-       ||  !prefs_common.ext_editor_cmd[0])
+               g_free(content_type);
+               content_type = NULL;
+       } else if (partinfo->type != MIMETYPE_TEXT || !prefs_common.ext_editor_cmd
+       ||  !prefs_common.ext_editor_cmd[0]) {
                mime_command = mailcap_get_command_for_type(content_type, filename);
-       else
+       } else {
                mime_command = g_strdup(prefs_common.ext_editor_cmd);
-
+               g_free(content_type);
+               content_type = NULL;
+       }
        if (mime_command == NULL) {
                /* try with extension this time */
                g_free(content_type);