finish the sync with 0.9.5cvs2
authorPaul Mangan <paul@claws-mail.org>
Thu, 11 Sep 2003 11:15:23 +0000 (11:15 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 11 Sep 2003 11:15:23 +0000 (11:15 +0000)
ChangeLog.claws
configure.ac
src/rfc2015.c

index f872438ae7a5f7d1a35c123acc76490bafba98e2..042d91420d3afff4a51bcf16835bca7355e055b6 100644 (file)
@@ -1,9 +1,17 @@
+2003-09-11 [paul]      0.9.5claws5
+
+       * src/rfc2015.c
+         src/common/utils.h
+               more sync'ing from 0.9.5cvs2
+
+       fixes bug 197 'Header lines encrypted by GPG'
+
 2003-09-11 [christoph] 0.9.5claws4
 
        * src/compose.c
        * src/rfc2015.c
        * src/common/utils.h
 2003-09-11 [christoph] 0.9.5claws4
 
        * src/compose.c
        * src/rfc2015.c
        * src/common/utils.h
-               fix last sync
+               fix sync with 0.9.5cvs2
 
 2003-09-11 [paul]      0.9.5claws3
 
 
 2003-09-11 [paul]      0.9.5claws3
 
@@ -15,8 +23,6 @@
        * sync with 0.9.5cvs2
                see ChangeLog 2003-09-05
                
        * sync with 0.9.5cvs2
                see ChangeLog 2003-09-05
                
-       fixes bug 197 'Header lines encrypted by GPG'
-
 2003-09-11 [paul]      0.9.5claws1
 
        * sync with 0.9.5cvs3
 2003-09-11 [paul]      0.9.5claws1
 
        * sync with 0.9.5cvs3
index 4f2aa58e27e5538533ee9ddac8e146e1a5c8f17a..01a0ffa442c1e4dea6c06bbe7b76e7579251ee2b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=4
+EXTRA_VERSION=5
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index d90d1dba141326d6f8fa141292e0f2437d7f7185..cb9bc1883e3c00d05e9177565a2cf9b6e3597c61 100644 (file)
@@ -650,6 +650,7 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
     FILE *dstfp;
     size_t nread;
     char buf[BUFFSIZE];
     FILE *dstfp;
     size_t nread;
     char buf[BUFFSIZE];
+    int in_cline;
     GpgmeError err;
 
     g_return_if_fail (msginfo != NULL);
     GpgmeError err;
 
     g_return_if_fail (msginfo != NULL);
@@ -708,9 +709,17 @@ void rfc2015_decrypt_message (MsgInfo *msginfo, MimeInfo *mimeinfo, FILE *fp)
     if (fseek(fp, tmpinfo->fpos, SEEK_SET) < 0)
         perror("fseek");
 
     if (fseek(fp, tmpinfo->fpos, SEEK_SET) < 0)
         perror("fseek");
 
+    in_cline = 0;
     while (fgets(buf, sizeof(buf), fp)) {
     while (fgets(buf, sizeof(buf), fp)) {
-        if (headerp (buf, content_names))
+        if (headerp (buf, content_names)) {
+            in_cline = 1;
             continue;
             continue;
+        }
+        if (in_cline) {
+            if (buf[0] == ' ' || buf[0] == '\t')
+                continue;
+            in_cline = 0;
+        }
         if (buf[0] == '\r' || buf[0] == '\n')
             break;
         fputs (buf, dstfp);
         if (buf[0] == '\r' || buf[0] == '\n')
             break;
         fputs (buf, dstfp);
@@ -829,7 +838,9 @@ rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored)
     GpgmeRecipients rset = NULL;
     size_t nread;
     int mime_version_seen = 0;
     GpgmeRecipients rset = NULL;
     size_t nread;
     int mime_version_seen = 0;
-    char *boundary = generate_mime_boundary ("Encrypt");
+    char *boundary;
+
+    boundary = generate_mime_boundary ("Encrypt");
 
     /* Create the list of recipients */
     rset = gpgmegtk_recipient_selection (recp_list);
 
     /* Create the list of recipients */
     rset = gpgmegtk_recipient_selection (recp_list);
@@ -853,7 +864,7 @@ rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored)
     }
 
     /* get the content header lines from the source */
     }
 
     /* get the content header lines from the source */
-    clineidx=0;
+    clineidx = 0;
     saved_last = 0;
     while (!err && fgets(buf, sizeof(buf), fp)) {
         /* fixme: check for overlong lines */
     saved_last = 0;
     while (!err && fgets(buf, sizeof(buf), fp)) {
         /* fixme: check for overlong lines */
@@ -867,13 +878,13 @@ rfc2015_encrypt (const char *file, GSList *recp_list, gboolean ascii_armored)
             continue;
         }
         if (saved_last) {
             continue;
         }
         if (saved_last) {
-            saved_last = 0;
             if (*buf == ' ' || *buf == '\t') {
             if (*buf == ' ' || *buf == '\t') {
-                char *last = clines[clineidx-1];
-                clines[clineidx-1] = g_strconcat (last, buf, NULL);
+                char *last = clines[clineidx - 1];
+                clines[clineidx - 1] = g_strconcat (last, buf, NULL);
                 g_free (last);
                 continue;
             }
                 g_free (last);
                 continue;
             }
+            saved_last = 0;
         }
 
         if (headerp (buf, mime_version_name)) 
         }
 
         if (headerp (buf, mime_version_name)) 
@@ -1161,10 +1172,12 @@ rfc2015_sign (const char *file, GSList *key_list)
     GpgmeData sigdata = NULL;
     size_t nread;
     int mime_version_seen = 0;
     GpgmeData sigdata = NULL;
     size_t nread;
     int mime_version_seen = 0;
-    char *boundary = generate_mime_boundary ("Signature");
+    char *boundary;
     char *micalg = NULL;
     char *siginfo;
 
     char *micalg = NULL;
     char *siginfo;
 
+    boundary = generate_mime_boundary ("Signature");
+
     /* Open the source file */
     if ((fp = fopen(file, "rb")) == NULL) {
         FILE_OP_ERROR(file, "fopen");
     /* Open the source file */
     if ((fp = fopen(file, "rb")) == NULL) {
         FILE_OP_ERROR(file, "fopen");
@@ -1194,13 +1207,13 @@ rfc2015_sign (const char *file, GSList *key_list)
             continue;
         }
         if (saved_last) {
             continue;
         }
         if (saved_last) {
-            saved_last = 0;
             if (*buf == ' ' || *buf == '\t') {
                 char *last = clines[clineidx - 1];
                 clines[clineidx - 1] = g_strconcat (last, buf, NULL);
                 g_free (last);
                 continue;
             }
             if (*buf == ' ' || *buf == '\t') {
                 char *last = clines[clineidx - 1];
                 clines[clineidx - 1] = g_strconcat (last, buf, NULL);
                 g_free (last);
                 continue;
             }
+            saved_last = 0;
         }
 
         if (headerp (buf, mime_version_name)) 
         }
 
         if (headerp (buf, mime_version_name)) 
@@ -1277,7 +1290,7 @@ rfc2015_sign (const char *file, GSList *key_list)
     fprintf (fp, "Content-Type: multipart/signed; "
              "protocol=\"application/pgp-signature\";\r\n");
     if (micalg)
     fprintf (fp, "Content-Type: multipart/signed; "
              "protocol=\"application/pgp-signature\";\r\n");
     if (micalg)
-        fprintf (fp, " micalg=\"%s\";", micalg);
+        fprintf (fp, " micalg=\"%s\";\r\n", micalg);
     fprintf (fp, " boundary=\"%s\"\r\n", boundary);
 
     /* Part 1: signed material */
     fprintf (fp, " boundary=\"%s\"\r\n", boundary);
 
     /* Part 1: signed material */