fix memory leak in
authorPaul Mangan <paul@claws-mail.org>
Fri, 24 May 2002 10:52:05 +0000 (10:52 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 24 May 2002 10:52:05 +0000 (10:52 +0000)
compose_redirect_write_headers_from_headerlist()
add Subject and Resent-Message-ID to
compose_redirect_write_headers()
Received, Subject, and X-UIDL are filtered out in
compose_redirect_write_to_file()

ChangeLog.claws
configure.in
src/compose.c

index 868e8fe0fffd0f3451bdcc48b424df6d86521d48..cb9e3a2f5c22ae1c4f381a671e7921218eb4e49a 100644 (file)
@@ -1,3 +1,13 @@
+2002-05-24 [paul]      0.7.6claws14
+
+       * src/compose.c
+               fix memory leak in 
+               compose_redirect_write_headers_from_headerlist()
+               add Subject and Resent-Message-ID to
+               compose_redirect_write_headers()
+               Received, Subject, and X-UIDL are filtered out in 
+               compose_redirect_write_to_file()
+
 2002-05-23 [paul]      0.7.6claws13
 
        * src/compose.[ch]
index 2860fc30d5161a6ef2abd5f7e5f8eb7d9534e2b3..4d72217bca0395dbc23077eafcfd3040c433f30a 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws13
+EXTRA_VERSION=claws14
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 95b1d679a32a1982dcfe8f1419c21a72e4eb8617..99938cde1ddd910fc2283637f5617689b56f5869 100644 (file)
@@ -2860,17 +2860,14 @@ static gint compose_redirect_write_headers_from_headerlist(Compose *compose,
        GSList *list;
        ComposeHeaderEntry *headerentry;
        gchar *headerentryname;
-       gchar *header_w_colon;
        gchar *cc_hdr;
        gchar *to_hdr;
 
        debug_print(_("Writing redirect header\n"));
 
-       header_w_colon = g_strconcat("To:", NULL);
-       to_hdr = (prefs_common.trans_hdr ? gettext(header_w_colon) : header_w_colon);
-       header_w_colon = g_strconcat("Cc:", NULL);
-       cc_hdr = (prefs_common.trans_hdr ? gettext(header_w_colon) : header_w_colon);
-       
+       cc_hdr = prefs_common.trans_hdr ? _("Cc:") : "Cc:";
+       to_hdr = prefs_common.trans_hdr ? _("To:") : "To:";
+
        first_address = TRUE;
        for(list = compose->header_list; list; list = list->next) {
                headerentry = ((ComposeHeaderEntry *)list->data);
@@ -2912,11 +2909,11 @@ static gint compose_redirect_write_headers(Compose *compose, FILE *fp)
        g_return_val_if_fail(compose->account != NULL, -1);
        g_return_val_if_fail(compose->account->address != NULL, -1);
 
-       /* Date */
+       /* Resent-Date */
        get_rfc822_date(buf, sizeof(buf));
        fprintf(fp, "Resent-Date: %s\n", buf);
 
-       /* From */
+       /* Resent-From */
        if (compose->account->name && *compose->account->name) {
                compose_convert_header
                        (buf, sizeof(buf), compose->account->name,
@@ -2926,7 +2923,25 @@ static gint compose_redirect_write_headers(Compose *compose, FILE *fp)
        } else
                fprintf(fp, "Resent-From: %s\n", compose->account->address);
 
-       /* To */
+       /* Subject */
+       str = gtk_entry_get_text(GTK_ENTRY(compose->subject_entry));
+       if (*str != '\0') {
+               Xstrdup_a(str, str, return -1);
+               g_strstrip(str);
+               if (*str != '\0') {
+                       compose_convert_header(buf, sizeof(buf), str,
+                                              strlen("Subject: "));
+                       fprintf(fp, "Subject: %s\n", buf);
+               }
+       }
+
+       /* Resent-Message-ID */
+       if (compose->account->gen_msgid) {
+               compose_generate_msgid(compose, buf, sizeof(buf));
+               fprintf(fp, "Resent-Message-Id: <%s>\n", buf);
+               compose->msgid = g_strdup(buf);
+       }
+
        compose_redirect_write_headers_from_headerlist(compose, fp);
 
        /* separator between header and body */
@@ -2961,10 +2976,16 @@ static gint compose_redirect_write_to_file(Compose *compose, const gchar *file)
 
        while (procheader_get_unfolded_line(buf, sizeof(buf), fp)) {
                /* should filter returnpath, delivered-to */
-               if ((g_strncasecmp(buf, "Return-Path:",
-                                  strlen("Return-Path:")) == 0)
-                   || (g_strncasecmp(buf, "Delivered-To:",
-                                     strlen("Delivered-To:")) == 0))
+               if (g_strncasecmp(buf, "Return-Path:",
+                                  strlen("Return-Path:")) == 0 ||
+                   g_strncasecmp(buf, "Delivered-To:",
+                                 strlen("Delivered-To:")) == 0 ||
+                   g_strncasecmp(buf, "Received:",
+                                 strlen("Received:")) == 0 ||
+                   g_strncasecmp(buf, "Subject:",
+                                 strlen("Subject:")) == 0 ||
+                   g_strncasecmp(buf, "X-UIDL:",
+                                 strlen("X-UIDL:")) == 0)
                        continue;
 
                if (fputs(buf, fdest) == -1)