fixed memleaks, coding style
authorThorsten Maerz <torte@netztorte.de>
Sun, 21 Jul 2002 20:13:13 +0000 (20:13 +0000)
committerThorsten Maerz <torte@netztorte.de>
Sun, 21 Jul 2002 20:13:13 +0000 (20:13 +0000)
ChangeLog.claws
configure.in
src/mimeview.c

index 83ad1ff..dc5dc69 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-21 [thorsten]  0.7.8claws91
+
+       * src/mimeview.c
+               fixed memleaks, coding style as pointed out by alfons
+
 2002-07-21 [alfons]    0.7.8claws90
 
        * src/messageview.c
index 874d96a..bbf4793 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws90
+EXTRA_VERSION=claws91
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 2fe0fea..c98d16e 100644 (file)
@@ -805,51 +805,46 @@ static void mimeview_save_all(MimeView *mimeview)
 
        partinfo = gtk_ctree_node_get_row_data
                (GTK_CTREE(mimeview->ctree), mimeview->opened);
-
        g_return_if_fail(partinfo != NULL);
 
        dirname = filesel_select_file(_("Save as"), defname);
-
        if (!dirname) return;
 
        /* return to first children */
        attachment = partinfo->parent->children->next;
-
        /* for each attachment, extract it in the selected dir. */
        while(attachment != NULL)
        {
-               if(attachment->filename)
-               {
+               if(attachment->filename) {
+                       gchar *attachdir;
                        gchar *attachname = g_strdup(attachment->filename);
 
                        subst_chars(attachname, "/\\", G_DIR_SEPARATOR);
                        subst_chars(attachname, ":?*&|<>\t\r\n", '_');
                        g_snprintf(buf, sizeof(buf), "%s%s",
-                                       dirname,
-                                       (attachname[0] == G_DIR_SEPARATOR)
-                                       ? &attachname[1]
-                                       : attachname );
-                       g_free(attachname);
+                                  dirname,
+                                  (attachname[0] == G_DIR_SEPARATOR)
+                                  ? &attachname[1]
+                                  : attachname);
+                       attachdir = g_dirname(buf);
                        make_dir_hier(g_dirname(buf));
+                       g_free(attachdir);
+                       g_free(attachname);
 
-                       if (is_file_exist(buf))
-                       {
+                       if (is_file_exist(buf)) {
                                AlertValue aval;
 
                                aval = alertpanel(_("Overwrite"),
-                                               _("Overwrite existing file?"),
-                                               _("OK"), _("Cancel"), NULL);
-
+                                                 _("Overwrite existing file?"),
+                                                 _("OK"), _("Cancel"), NULL);
                                if (G_ALERTDEFAULT != aval) return;
                        }
-
                        if (procmime_get_part(buf, mimeview->file, attachment) < 0)
-                               alertpanel_error
-                                       (_("Can't save the part of multipart message."));
+                               alertpanel_error(_("Can't save the part of multipart message."));
                }
-
                attachment = attachment->next;
        }
+       g_free(dirname);
 }
 
 static void mimeview_display_as_text(MimeView *mimeview)