Description: Fix the --header-X-test header (fix supplied by upstream
 through the bug report)
Author: John Jetmore <jj33@pobox.com>
Bug-Debian: http://bugs.debian.org/608338
Origin: upstream
Forwarded: not-needed
Last-Update: 2011-01-06
===================================================================
--- swaks-20100211.0.orig/swaks	2011-01-05 22:19:17.000000000 -0600
+++ swaks-20100211.0/swaks	2011-01-05 22:19:42.000000000 -0600
@@ -1705,15 +1705,11 @@
     if (defined($o->{header}) && ref($o->{header}) eq 'ARRAY'
                               && scalar(@{$o->{header}}))
     {
-      #my %matched = ();
       foreach my $l (map { split(/\\n/) } @{$o->{header}}) {
         if (my($h) = $l =~ /^([^:]+):/) {
-          $n{data} =~ s/(^|\\n|\n)$h:.*?($|\\n|\n)/$1$l$2/;
-          #if (!$matched{$h}
-          #    && $n{data} =~ s/(^|\\n|\n)$h:.*?($|\\n|\n)/$1$l$2/)
-          #{
-          #  $matched{$h} = 1;
-          #} else { push(@{$o->{add_header}}, $l); }
+          if ($n{data} !~ s/(^|\\n|\n)$h:.*?($|\\n|\n)/$1$l$2/) {
+            push(@{$o->{add_header}}, $l);
+          }
         } else { push(@{$o->{add_header}}, $l); }
       }
     }
