Attachwarner: fix leaked string
[claws.git] / src / plugins / attachwarner / attachwarner.c
index e4d19a9e8a0ce7ad28e9e137f85b3697f6f54a28..4dd8f96eccf39e1a8809c1a1fc0b85f2e819bf81 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail Team
- * Copyright (C) 2006-2013 Ricardo Mones
+ * Copyright (C) 2006-2015 Ricardo Mones and the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,8 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation, 
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -111,7 +109,7 @@ AttachWarnerMention *are_attachments_mentioned(Compose *compose)
        AttachWarnerMention *mention = NULL;
        MatcherList *matchers = NULL;
 
-       matchers = matcherlist_new_from_lines(attwarnerprefs.match_strings, FALSE);
+       matchers = matcherlist_new_from_lines(attwarnerprefs.match_strings, FALSE, attwarnerprefs.case_sensitive);
 
        if (matchers == NULL) {
                g_warning("couldn't allocate matcher");
@@ -205,21 +203,28 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
                AlertValue aval;
                gchar *button_label;
                gchar *message;
+               gchar *bold_text;
                
                debug_print("user has to decide\n");
                if (compose->sending)
-                       button_label = _("+_Send");
+                       button_label = g_strconcat("+", _("_Send"), NULL);
                else
-                       button_label = _("+_Queue");
+                       button_label = g_strconcat("+", _("_Queue"), NULL);
 
+               bold_text = g_strdup_printf("<span weight=\"bold\">%.20s</span>...",
+                               mention->context);
                message = g_strdup_printf(
-                               _("An attachment is mentioned in the mail you're sending, but no file was attached. Mention appears on line %d, which begins with text: <span weight=\"bold\">%.20s</span>...\n\n%s it anyway?"),
+                               _("An attachment is mentioned in the mail you're sending, "
+                               "but no file was attached. Mention appears on line %d, "
+                               "which begins with text: %s\n\n%s"),
                                mention->line,
-                               mention->context,
-                               compose->sending?_("Send"):_("Queue"));
+                               bold_text,
+                               compose->sending?_("Send it anyway?"):_("Queue it anyway?"));
                aval = alertpanel(_("Attachment warning"), message,
                                  GTK_STOCK_CANCEL, button_label, NULL);
                g_free(message);
+               g_free(bold_text);
+               g_free(button_label);
                if (aval != G_ALERTALTERNATE)
                        return TRUE;
        }