0.9.8claws14
authorLuke Plant <L.Plant.98@cantab.net>
Tue, 30 Dec 2003 15:04:20 +0000 (15:04 +0000)
committerLuke Plant <L.Plant.98@cantab.net>
Tue, 30 Dec 2003 15:04:20 +0000 (15:04 +0000)
* src/procheader.c
o added procheader_get_one_field_asis() that does not do
  unfolding
o fix procheader_get_header_array_asis() to use the above,
  fixing ugliness of headers in textview

* src/compose.c
o don't unfold headers when redirecting.

ChangeLog.claws
configure.ac
src/compose.c
src/procheader.c
src/procheader.h

index 0e68310ac14f8031be9601dafb3d151926f4f71c..dd87e2e5d82b1b19cfa944b4409559e675d6fd15 100644 (file)
@@ -1,3 +1,13 @@
+2003-12-30 [luke]      0.9.8claws14
+       * src/procheader.[ch]
+               o added procheader_get_one_field_asis() that does not do
+                 unfolding
+               o fix procheader_get_header_array_asis() to use the above,
+                 fixing ugliness of headers in textview
+
+       * src/compose.c
+               o don't unfold headers when redirecting.        
+
 2003-12-30 [paul]      0.9.8claws13
 
        * po/POTFILES.in
index 2fe465d0d178520d79c30940e7ed586c2ba3cc39..cc3b4a6e84df81f996cbb145e2bc7fada3ab26f5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=13
+EXTRA_VERSION=14
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 365903969b66d6b4df171fa528843b70f3de5816..17cad87c669d91a40317f9b451428ef6ef338546 100644 (file)
@@ -3371,7 +3371,7 @@ static gint compose_redirect_write_to_file(Compose *compose, const gchar *file)
                g_warning("can't change file mode\n");
        }
 
-       while (procheader_get_one_field(buf, sizeof(buf), fp, NULL) != -1) {
+       while (procheader_get_one_field_asis(buf, sizeof(buf), fp) != -1) {
                /* should filter returnpath, delivered-to */
                if (g_strncasecmp(buf, "Return-Path:",
                                   strlen("Return-Path:")) == 0 ||
index 151496470a4feb3d5467bfc70814bf16d64f4310..abc49555b429fd705558a602424b8dc218cdb3b6 100644 (file)
@@ -168,6 +168,35 @@ static gint generic_get_one_field(gchar *buf, gint len, void *data,
        return hnum;
 }
 
+gint procheader_get_one_field_asis(gchar *buf, gint len, FILE *fp)
+{
+       gint nexthead;
+
+       if (fgets(buf, len, fp) == NULL) return -1;
+       if (buf[0] == '\r' || buf[0] == '\n') return -1;
+
+       /* concatenate multi-line fields */
+       while (1) {
+               nexthead = file_peekchar(fp);
+               /* ([*WSP CRLF] 1*WSP) */
+               if (nexthead == ' ' || nexthead == '\t') {
+                       size_t buflen = strlen(buf);
+                       
+                       /* concatenate next line */
+                       if ((len - buflen) > 2) {
+                               if (fgets(buf + buflen, len - buflen, fp) == NULL)
+                                       break;
+                       } else
+                               break;
+               } else {
+                       /* remove trailing new line */
+                       strretchomp(buf);
+                       break;
+               }
+       }
+       return 0;
+}
+
 #if 0
 gchar *procheader_get_unfolded_line(gchar *buf, gint len, FILE *fp)
 {
@@ -326,7 +355,7 @@ GPtrArray *procheader_get_header_array_asis(FILE *fp)
 
        headers = g_ptr_array_new();
 
-       while (procheader_get_one_field(buf, sizeof(buf), fp, NULL) != -1) {
+       while (procheader_get_one_field_asis(buf, sizeof(buf), fp) != -1) {
                if ((header = procheader_parse_header(buf)) != NULL)
                        g_ptr_array_add(headers, header);
                        /*
index 1e9afad2dbe973706665c37fbbd96b25fd0f20d8..11cd3644977e21e9d193d0422319830659dfd9c1 100644 (file)
@@ -46,6 +46,9 @@ gint procheader_get_one_field         (gchar          *buf,
                                         gint            len,
                                         FILE           *fp,
                                         HeaderEntry     hentry[]);
+gint procheader_get_one_field_asis     (gchar          *buf,
+                                        gint            len,
+                                        FILE           *fp);
 gchar *procheader_get_unfolded_line    (gchar          *buf,
                                         gint            len,
                                         FILE           *fp);