]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
no_partial_rewrite was incorrectly set always
authorTimo Sirainen <tss@iki.fi>
Tue, 29 Jun 2004 13:18:21 +0000 (16:18 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 29 Jun 2004 13:18:21 +0000 (16:18 +0300)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-sync-parse.c

index 6f9cfbc701512d4a6d5e3e50de430aa8482be8b9..18a45aaffcabfb9e76971f43564f67e845aa06eb 100644 (file)
@@ -382,18 +382,20 @@ void mbox_sync_parse_next_mail(struct istream *input,
                        line_start_pos = str_len(ctx->header);
                        str_append(ctx->header, hdr->name);
                        str_append(ctx->header, ": ");
-               }
 
-               if (ctx->header_first_change == (size_t)-1 &&
-                   hdr->full_value_offset != str_len(ctx->header)) {
-                       /* whitespaces around ':' are non-standard. either
-                          there's whitespace before ':' or none after.
-                          if we're going to rewrite this message, we can't
-                          do it partially from here after as offsets won't
-                          match. this shouldn't happen pretty much ever, so
-                          don't try to optimize this - just rewrite the whole
-                          thing. */
-                       ctx->no_partial_rewrite = TRUE;
+                       if (ctx->header_first_change == (size_t)-1 &&
+                           hdr->full_value_offset - hdr->name_offset !=
+                           str_len(ctx->header) - line_start_pos) {
+                               /* whitespaces around ':' are non-standard.
+                                  either there's whitespace before ':' or none
+                                  after. if we're going to rewrite this
+                                  message, we can't do it partially from here
+                                  after as offsets won't match. this shouldn't
+                                  happen pretty much ever, so don't try to
+                                  optimize this - just rewrite the whole
+                                  thing. */
+                               ctx->no_partial_rewrite = TRUE;
+                       }
                }
 
                func = header_func_find(hdr->name);