2004-11-13 [paul] 0.9.12cvs146.7
authorPaul Mangan <paul@claws-mail.org>
Sat, 13 Nov 2004 13:28:35 +0000 (13:28 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 13 Nov 2004 13:28:35 +0000 (13:28 +0000)
* src/compose.c
* src/exporthtml.c
* src/exportldif.c
* src/folder.c
* src/imap.c
* src/imap_gtk.c
* src/main.c
* src/mainwindow.c
* src/messageview.c
* src/mh_gtk.c
* src/prefs_themes.c
* src/procmime.c
* src/setup.c
* src/summaryview.c
replace deprecated g_basename

17 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c
src/exporthtml.c
src/exportldif.c
src/folder.c
src/imap.c
src/imap_gtk.c
src/main.c
src/mainwindow.c
src/messageview.c
src/mh_gtk.c
src/prefs_themes.c
src/procmime.c
src/setup.c
src/summaryview.c

index cb029bb..d50d324 100644 (file)
@@ -1,3 +1,21 @@
+2004-11-13 [paul]      0.9.12cvs146.7
+
+       * src/compose.c
+       * src/exporthtml.c
+       * src/exportldif.c
+       * src/folder.c
+       * src/imap.c
+       * src/imap_gtk.c
+       * src/main.c
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/mh_gtk.c
+       * src/prefs_themes.c
+       * src/procmime.c
+       * src/setup.c
+       * src/summaryview.c
+               replace deprecated g_basename
+
 2004-11-13 [paul]      0.9.12cvs146.6
 
        * src/compose.c
index b793fe3..cb6163b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.2.2 -r 1.5.2.3 src/exporthtml.c; cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/exportldif.c; cvs diff -u -r 1.179.2.11 -r 1.179.2.12 src/imap.c; cvs diff -u -r 1.79.2.4 -r 1.79.2.5 src/mh.c; cvs diff -u -r 1.83.2.23 -r 1.83.2.24 src/mimeview.c; cvs diff -u -r 1.5.2.4 -r 1.5.2.5 src/prefs_spelling.c; cvs diff -u -r 1.3.2.8 -r 1.3.2.9 src/prefs_themes.c; ) > 0.9.12cvs146.4.patchset
 ( cvs diff -u -r 1.96.2.33 -r 1.96.2.34 src/textview.c; ) > 0.9.12cvs146.5.patchset
 ( cvs diff -u -r 1.382.2.62 -r 1.382.2.63 src/compose.c; cvs diff -u -r 1.179.2.12 -r 1.179.2.13 src/imap.c; cvs diff -u -r 1.4.2.2 -r 1.4.2.3 src/matcher_parser.h; cvs diff -u -r 1.25.2.5 -r 1.25.2.6 src/matcher_parser_parse.y; cvs diff -u -r 1.59.2.8 -r 1.59.2.9 src/prefs_filtering.c; cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/prefs_filtering_action.c; cvs diff -u -r 1.3.2.9 -r 1.3.2.10 src/prefs_themes.c; cvs diff -u -r 1.30.2.5 -r 1.30.2.6 src/prefs_toolbar.c; cvs diff -u -r 1.36.2.14 -r 1.36.2.15 src/common/utils.c; ) > 0.9.12cvs146.6.patchset
+( cvs diff -u -r 1.382.2.63 -r 1.382.2.64 src/compose.c; cvs diff -u -r 1.5.2.3 -r 1.5.2.4 src/exporthtml.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/exportldif.c; cvs diff -u -r 1.213.2.20 -r 1.213.2.21 src/folder.c; cvs diff -u -r 1.179.2.13 -r 1.179.2.14 src/imap.c; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/imap_gtk.c; cvs diff -u -r 1.115.2.22 -r 1.115.2.23 src/main.c; cvs diff -u -r 1.274.2.23 -r 1.274.2.24 src/mainwindow.c; cvs diff -u -r 1.94.2.32 -r 1.94.2.33 src/messageview.c; cvs diff -u -r 1.2.2.3 -r 1.2.2.4 src/mh_gtk.c; cvs diff -u -r 1.3.2.10 -r 1.3.2.11 src/prefs_themes.c; cvs diff -u -r 1.49.2.19 -r 1.49.2.20 src/procmime.c; cvs diff -u -r 1.5.2.2 -r 1.5.2.3 src/setup.c; cvs diff -u -r 1.395.2.39 -r 1.395.2.40 src/summaryview.c; ) > 0.9.12cvs146.7.patchset
index ae8a1b4..a9f183b 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=146
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.6
+EXTRA_GTK2_VERSION=.7
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index ecdf0ee..9eadf1b 100644 (file)
@@ -2173,6 +2173,7 @@ static void compose_attach_append(Compose *compose, const gchar *file,
        FILE *fp;
        off_t size;
        gint row;
+       gchar *name;
 
        if (!is_file_exist(file)) {
                g_warning("File %s doesn't exist\n", file);
@@ -2208,7 +2209,6 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                if (!g_ascii_strcasecmp(content_type, "message/rfc822")) {
                        MsgInfo *msginfo;
                        MsgFlags flags = {0, 0};
-                       const gchar *name;
 
                        if (procmime_get_encoding_for_file(file) == ENC_7BIT)
                                ainfo->encoding = ENC_7BIT;
@@ -2219,7 +2219,7 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                        if (msginfo && msginfo->subject)
                                name = msginfo->subject;
                        else
-                               name = g_basename(filename ? filename : file);
+                               name = g_path_get_basename(filename ? filename : file);
 
                        ainfo->name = g_strdup_printf(_("Message: %s"), name);
 
@@ -2230,9 +2230,10 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                                        procmime_get_encoding_for_file(file);
                        else
                                ainfo->encoding = ENC_BASE64;
-                       ainfo->name = g_strdup
-                               (g_basename(filename ? filename : file));
+                       name = g_path_get_basename(filename ? filename : file);
+                       ainfo->name = g_strdup(name);
                }
+               g_free(name);
        } else {
                ainfo->content_type = procmime_get_mime_type(file);
                if (!ainfo->content_type) {
@@ -2243,7 +2244,9 @@ static void compose_attach_append(Compose *compose, const gchar *file,
                        ainfo->encoding = procmime_get_encoding_for_file(file);
                else
                        ainfo->encoding = ENC_BASE64;
-               ainfo->name = g_strdup(g_basename(filename ? filename : file)); 
+               name = g_path_get_basename(filename ? filename : file);
+               ainfo->name = g_strdup(name);   
+               g_free(name);
        }
 
        if (!strcmp(ainfo->content_type, "unknown")) {
@@ -4259,7 +4262,7 @@ static gchar *compose_get_header(Compose *compose)
                g_free(tmp);
                
                entry_str = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
-               Xstrdup_a(headervalue, entry_str, return FALSE);
+               Xstrdup_a(headervalue, entry_str, return NULL);
                subst_char(headervalue, '\r', ' ');
                subst_char(headervalue, '\n', ' ');
                string = std_headers;
@@ -6386,7 +6389,7 @@ static void compose_insert_file_cb(gpointer data, guint action,
                for ( tmp = file_list; tmp; tmp = tmp->next) {
                        gchar *file = (gchar *) tmp->data;
                        gchar *filedup = g_strdup(file);
-                       const gchar *shortfile = g_basename(filedup);
+                       gchar *shortfile = g_path_get_basename(filedup);
                        ComposeInsertResult res;
 
                        res = compose_insert_file(compose, file);
@@ -6396,6 +6399,7 @@ static void compose_insert_file_cb(gpointer data, guint action,
                                alertpanel_error(_("File '%s' contained invalid characters\n"
                                                   "for the current encoding, insertion may be incorrect."), shortfile);
                        }
+                       g_free(shortfile);
                        g_free(filedup);
                        g_free(file);
                }
index 69b1955..aa3414f 100644 (file)
@@ -1051,9 +1051,11 @@ static void exporthtml_build_filespec( ExportHtmlCtl *ctl ) {
  */
 void exporthtml_parse_filespec( ExportHtmlCtl *ctl, gchar *fileSpec ) {
        gchar *t;
+       gchar *base = g_path_get_basename(fileSpec);
 
        ctl->fileHtml =
-               mgu_replace_string( ctl->fileHtml, g_basename( fileSpec ) );
+               mgu_replace_string( ctl->fileHtml, base );
+       g_free(base);
        t = g_path_get_dirname( fileSpec );
        ctl->dirOutput = mgu_replace_string( ctl->dirOutput, t );
        g_free( t );
index 9329440..c2c1e4d 100644 (file)
@@ -534,9 +534,11 @@ static void exportldif_build_filespec( ExportLdifCtl *ctl ) {
  */
 void exportldif_parse_filespec( ExportLdifCtl *ctl, gchar *fileSpec ) {
        gchar *t;
+       gchar *base = g_path_get_basename(fileSpec);
 
        ctl->fileLdif =
-               mgu_replace_string( ctl->fileLdif, g_basename( fileSpec ) );
+               mgu_replace_string( ctl->fileLdif, base );
+       g_free(base);
        t = g_path_get_dirname( fileSpec );
        ctl->dirOutput = mgu_replace_string( ctl->dirOutput, t );
        g_free( t );
index f50b6d7..0c6bae3 100644 (file)
@@ -1063,8 +1063,10 @@ FolderItem *folder_find_child_item_by_name(FolderItem *item, const gchar *name)
 
        for (node = item->node->children; node != NULL; node = node->next) {
                child = FOLDER_ITEM(node->data);
-               if (strcmp2(g_basename(child->path), name) == 0)
+               if (strcmp2(g_path_get_basename(child->path), name) == 0) {
+                       g_free(child->path);
                        return child;
+               }
        }
 
        return NULL;
@@ -2524,7 +2526,10 @@ gint folder_item_move_to(FolderItem *src, FolderItem *dest, FolderItem **new_ite
        }
 
        phys_srcpath = folder_item_get_path(src);
-       phys_dstpath = g_strconcat(folder_item_get_path(dest),G_DIR_SEPARATOR_S,g_basename(phys_srcpath),NULL);
+       phys_dstpath = g_strconcat(folder_item_get_path(dest),
+                      G_DIR_SEPARATOR_S,
+                      g_path_get_basename(phys_srcpath),
+                      NULL);
 
        if (folder_item_parent(src) == dest || src == dest) {
                g_free(src_identifier);
index f2bea38..efa78c9 100644 (file)
@@ -1368,9 +1368,9 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item)
                        new_item->stype = F_INBOX;
                        folder->inbox = new_item;
                } else if (!folder_item_parent(item) || item->stype == F_INBOX) {
-                       const gchar *base;
+                       gchar *base;
 
-                       base = g_basename(new_item->path);
+                       base = g_path_get_basename(new_item->path);
 
                        if (!folder->outbox && !g_ascii_strcasecmp(base, "Sent")) {
                                new_item->stype = F_OUTBOX;
@@ -1385,6 +1385,7 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item)
                                new_item->stype = F_TRASH;
                                folder->trash = new_item;
                        }
+                       g_free(base);
                }
 
                if (new_item->no_sub == FALSE)
@@ -1403,7 +1404,7 @@ static GSList *imap_parse_list(IMAPFolder *folder, IMAPSession *session,
        gchar flags[256];
        gchar separator_str[16];
        gchar *p;
-       const gchar *name;
+       gchar *base;
        gchar *loc_name, *loc_path;
        GSList *item_list = NULL;
        GString *str;
@@ -1462,10 +1463,10 @@ static GSList *imap_parse_list(IMAPFolder *folder, IMAPSession *session,
 
                if (separator_str[0] != '\0')
                        subst_char(buf, separator_str[0], '/');
-               name = g_basename(buf);
-               if (name[0] == '.') continue;
+               base = g_path_get_basename(buf);
+               if (base[0] == '.') continue;
 
-               loc_name = imap_modified_utf7_to_utf8(name);
+               loc_name = imap_modified_utf7_to_utf8(base);
                loc_path = imap_modified_utf7_to_utf8(buf);
                new_item = folder_item_new(FOLDER(folder), loc_name, loc_path);
                if (strcasestr(flags, "\\Noinferiors") != NULL)
@@ -1477,6 +1478,7 @@ static GSList *imap_parse_list(IMAPFolder *folder, IMAPSession *session,
                item_list = g_slist_append(item_list, new_item);
 
                debug_print("folder '%s' found.\n", loc_path);
+               g_free(base);
                g_free(loc_path);
                g_free(loc_name);
        }
index 155822e..7bb2f4e 100644 (file)
@@ -163,6 +163,7 @@ static void rename_folder_cb(FolderView *folderview, guint action,
        gchar *old_path;
        gchar *old_id;
        gchar *new_id;
+       gchar *base;
 
        item = folderview_get_selected_item(folderview);
        g_return_if_fail(item != NULL);
@@ -171,8 +172,9 @@ static void rename_folder_cb(FolderView *folderview, guint action,
 
        name = trim_string(item->name, 32);
        message = g_strdup_printf(_("Input new name for `%s':"), name);
-       new_folder = input_dialog(_("Rename folder"), message,
-                                 g_basename(item->path));
+       base = g_path_get_basename(item->path);
+       new_folder = input_dialog(_("Rename folder"), message, base);
+       g_free(base);
        g_free(message);
        g_free(name);
        if (!new_folder) return;
index 3211883..0afd9af 100644 (file)
@@ -585,8 +585,8 @@ static void parse_cmd_opt(int argc, char *argv[])
                } else if (!strncmp(argv[i], "--offline", 9)) {
                        cmd.online_mode = ONLINE_MODE_OFFLINE;
                } else if (!strncmp(argv[i], "--help", 6)) {
-                       g_print(_("Usage: %s [OPTION]...\n"),
-                               g_basename(argv[0]));
+                       gchar *base = g_path_get_basename(argv[0]);
+                       g_print(_("Usage: %s [OPTION]...\n"), base);
 
                        puts(_("  --compose [address]    open composition window"));
                        puts(_("  --attach file1 [file2]...\n"
@@ -605,6 +605,7 @@ static void parse_cmd_opt(int argc, char *argv[])
                        puts(_("  --version              output version information and exit"));
                        puts(_("  --config-dir           output configuration directory"));
 
+                       g_free(base);
                        exit(1);
                } else if (!strncmp(argv[i], "--crash", 7)) {
                        cmd.crash = TRUE;
index 008528e..a9a285d 100644 (file)
@@ -1637,8 +1637,8 @@ void main_window_add_mailbox(MainWindow *mainwin)
                return;
        }
        folder = folder_new(folder_get_class_from_string("mh"), 
-                           !strcmp(path, "Mail") ? _("Mailbox") : g_basename(path),
-                           path);
+                           !strcmp(path, "Mail") ? _("Mailbox") : 
+                           g_path_get_basename(path), path);
        g_free(path);
 
        if (folder->klass->create_tree(folder) < 0) {
index c7cb84d..c83d02d 100644 (file)
@@ -984,8 +984,9 @@ void messageview_save_as(MessageView *messageview)
        src = procmsg_get_message_file(msginfo);
        if (copy_file(src, dest, TRUE) < 0) {
                alertpanel_error(_("Can't save the file `%s'."),
-                                g_basename(dest));
+                                g_path_get_basename(dest));
        }
+       g_free(dest);
        g_free(src);
 }
 
index 6bc7596..8ebbb51 100644 (file)
@@ -206,6 +206,7 @@ static void rename_folder_cb(FolderView *folderview, guint action,
        gchar *old_path;
        gchar *old_id;
        gchar *new_id;
+       gchar *base;
 
        item = folderview_get_selected_item(folderview);
        g_return_if_fail(item != NULL);
@@ -214,10 +215,11 @@ static void rename_folder_cb(FolderView *folderview, guint action,
 
        name = trim_string(item->name, 32);
        message = g_strdup_printf(_("Input new name for `%s':"), name);
-       new_folder = input_dialog(_("Rename folder"), message,
-                                 g_basename(item->path));
+       base = g_path_get_basename(item->path);
+       new_folder = input_dialog(_("Rename folder"), message, base);
        g_free(message);
        g_free(name);
+       g_free(base);
        if (!new_folder) return;
        AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
 
index c2198b5..d48ef99 100644 (file)
@@ -178,44 +178,46 @@ static void prefs_themes_file_stats(const gchar *filename, gpointer data)
 static void prefs_themes_file_remove(const gchar *filename, gpointer data)
 {
        gchar **status = (gchar **)data;
-       const gchar *name;
+       gchar *base;
        
        if ((*status) != NULL)
                return;
        
-       name = g_basename(filename);
+       base = g_path_get_basename(filename);
        if (TRUE == is_dir_exist(filename)) {
-               if (!((name[0] == '.') || (name[0] == '.' && name[1] == '.')))
+               if (!((base[0] == '.') || (base[0] == '.' && base[1] == '.')))
                        g_warning("prefs_themes_file_remove(): subdir in theme dir skipped.\n");
        }
        else if (0 != unlink(filename)) {
                (*status) = g_strdup(filename);
        }
+       g_free(base);
 }
 
 static void prefs_themes_file_install(const gchar *filename, gpointer data)
 {
        CopyInfo *ci = (CopyInfo *)data;
-       const gchar *name;
+       gchar *base;
        
        if (ci->status != NULL)
                return;
        
-       name = g_basename(filename);
+       base = g_path_get_basename(filename);
        if (TRUE == is_dir_exist(filename)) {
-               if (!((name[0] == '.') || (name[0] == '.' && name[1] == '.')))
+               if (!((base[0] == '.') || (base[0] == '.' && base[1] == '.')))
                        g_warning("prefs_themes_file_install(): subdir in theme dir skipped.\n");
        }
        else {
                gchar *fulldest;
                
-               fulldest = g_strconcat(ci->dest, G_DIR_SEPARATOR_S, name, NULL);
+               fulldest = g_strconcat(ci->dest, G_DIR_SEPARATOR_S, base, NULL);
                
                if (0 != copy_file(filename, fulldest, FALSE)) {
                        ci->status = g_strdup(filename);
                }
                g_free(fulldest);
        }
+       g_free(base);
 }
 
 static void prefs_themes_foreach_file(const gchar *dirname, const FileFunc func, gpointer data)
@@ -307,7 +309,7 @@ static void prefs_themes_get_themes_and_names(ThemesData *tdata)
        tpaths = tdata->themes;
        while (tpaths != NULL) {
                ThemeName *name = g_new0(ThemeName, 1);
-               const gchar *sname = g_basename((gchar *)(tpaths->data));
+               gchar *sname = g_path_get_basename((const gchar *)(tpaths->data));
                
                if (IS_INTERNAL_THEME(sname))
                        name->name = g_strdup(_("Default internal theme"));
@@ -317,7 +319,8 @@ static void prefs_themes_get_themes_and_names(ThemesData *tdata)
                        
                tdata->names = g_list_append(tdata->names, name);
                tpaths = g_list_next(tpaths);
-       }       
+               g_free(sname);  
+       }
 }
 
 void prefs_themes_init(void)
@@ -416,11 +419,11 @@ static void prefs_themes_btn_remove_clicked_cb(GtkWidget *widget, gpointer data)
                        return;
                }
                alert_title = g_strdup_printf(_("Remove system theme '%s'"), 
-                                             g_basename(theme_str));
+                                             g_path_get_basename(theme_str));
        }
        if (NULL == alert_title) {
                alert_title = g_strdup_printf(_("Remove theme '%s'"), 
-                                             g_basename(theme_str));
+                                             g_path_get_basename(theme_str));
        }
        val = alertpanel(alert_title,
                         _("Are you sure you want to remove this theme?"),
@@ -448,13 +451,13 @@ static void prefs_themes_btn_remove_clicked_cb(GtkWidget *widget, gpointer data)
                        prefs_themes_get_theme_info(tdata);
                }
        }
+       g_free(theme_str);
 }
 
 static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data)
 {
        gchar      *filename, *source;
-       gchar      *themeinfo;
-       const gchar *themename;
+       gchar      *themeinfo, *themename;
        gchar      *alert_title = NULL;
        CopyInfo   *cinfo;
        AlertValue  val = 0;
@@ -466,7 +469,7 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
        
        cinfo = g_new0(CopyInfo, 1);
        source = g_path_get_dirname(filename);
-       themename = g_basename(source);
+       themename = g_path_get_basename(source);
        debug_print("Installing '%s' theme from %s\n", themename, filename);
 
        themeinfo = g_strconcat(source, G_DIR_SEPARATOR_S, THEMEINFO_FILE, NULL);
@@ -534,6 +537,7 @@ end_inst:
        g_free(source);
        g_free(themeinfo);
        g_free(cinfo);
+       g_free(themename);
 }
 
 static void prefs_themes_btn_more_clicked_cb(GtkWidget *widget, gpointer data)
index bff4513..6029e44 100644 (file)
@@ -802,7 +802,7 @@ gboolean procmime_find_string(MsgInfo *msginfo, const gchar *str,
 gchar *procmime_get_tmp_file_name(MimeInfo *mimeinfo)
 {
        static guint32 id = 0;
-       const gchar *base;
+       gchar *base;
        gchar *filename;
        gchar f_prefix[10];
 
@@ -820,15 +820,16 @@ gchar *procmime_get_tmp_file_name(MimeInfo *mimeinfo)
                        basetmp = procmime_mimeinfo_get_parameter(mimeinfo, "name");
                if (basetmp == NULL)
                        basetmp = "mimetmp";
-               base = g_basename(basetmp);
+               base = g_path_get_basename(basetmp);
                if (*base == '\0') base = "mimetmp";
-               Xstrdup_a(base, base, return NULL);
+               Xstrdup_a(base, base, {g_free(base); return NULL;});
                subst_for_shellsafe_filename(base);
        }
 
        filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,
                               f_prefix, base, NULL);
 
+       g_free(base);
        return filename;
 }
 
@@ -840,14 +841,16 @@ gchar *procmime_get_mime_type(const gchar *filename)
        MimeType *mime_type;
        const gchar *p;
        gchar *ext;
+       gchar *base;
 
        if (!mime_type_table) {
                mime_type_table = procmime_get_mime_type_table();
                if (!mime_type_table) return NULL;
        }
 
-       filename = g_basename(filename);
-       p = strrchr(filename, '.');
+       base = g_path_get_basename(filename);
+       p = strrchr(base, '.');
+       g_free(base);
        if (!p) return NULL;
 
        Xstrdup_a(ext, p + 1, return NULL);
index 1109619..7f89b47 100644 (file)
@@ -54,6 +54,7 @@ void setup(MainWindow *mainwin)
 gboolean setup_write_mailbox_path(MainWindow *mainwin, const gchar *path)
 {
        Folder *folder;
+       gchar *base;
 
        if (!path) return FALSE;
        if (folder_find_from_path(path)) {
@@ -61,12 +62,14 @@ gboolean setup_write_mailbox_path(MainWindow *mainwin, const gchar *path)
                return FALSE;
        }
 
-       folder = folder_new(mh_get_class(), !strcmp(path, "Mail") ? _("Mailbox") : g_basename(path), path);
+       base = g_path_get_basename(path);
+       folder = folder_new(mh_get_class(), !strcmp(path, "Mail") ? _("Mailbox") : base, path);
 
        if (folder->klass->create_tree(folder) < 0) {
                alertpanel_error(_("Creation of the mailbox failed.\n"
                                   "Maybe some files already exist, or you don't have the permission to write there."));
                folder_destroy(folder);
+               g_free(base);
                return FALSE;
        }
 
@@ -74,6 +77,7 @@ gboolean setup_write_mailbox_path(MainWindow *mainwin, const gchar *path)
        folder_set_ui_func(folder, scan_tree_func, mainwin);
        folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
+       g_free(base);
        return TRUE;
 }
 
index cca6fe3..4589031 100644 (file)
@@ -3334,14 +3334,13 @@ void summary_save_as(SummaryView *summaryview)
        if ( aval==0 ) { /* append */
                if (append_file(src, dest, TRUE) < 0) 
                        alertpanel_error(_("Can't save the file `%s'."),
-                                        g_basename(dest));
+                                        g_path_get_basename(dest));
        } else { /* overwrite */
                if (copy_file(src, dest, TRUE) < 0)
                        alertpanel_error(_("Can't save the file `%s'."),
-                                        g_basename(dest));
+                                        g_path_get_basename(dest));
        }
        g_free(src);
-
        
        /*
         * If two or more msgs are selected,
@@ -3355,10 +3354,11 @@ void summary_save_as(SummaryView *summaryview)
                        src = procmsg_get_message_file(msginfo);
                        if (append_file(src, dest, TRUE) < 0)
                                alertpanel_error(_("Can't save the file `%s'."),
-                                                g_basename(dest));
+                                                g_path_get_basename(dest));
                }
                g_free(src);
        }
+       g_free(dest);
 }
 
 void summary_print(SummaryView *summaryview)