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 83ad1ff7d1093e9dc84f1355f780782f41359921..dc5dc696b722bf13cb5cdaec578eebd7d09261fc 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 874d96ac4b8a573f1eed72d46bbad7499122f481..bbf47933b633a383f7c920437e80e114b5f2929a 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 2fe0feadd7e64c9c5e3974afa6a327c4288847ac..c98d16e560e8e89a4a881357b7937701227e8d53 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)