From 4aa83920889add254f76745a96a85e51bc2f11cc Mon Sep 17 00:00:00 2001 From: Owen Dunn Date: Thu, 9 Oct 2014 13:34:44 +0100 Subject: [PATCH] bodge decodeBase64 Signed-off-by: Ian Jackson --- stump/bin/decodeBase64 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stump/bin/decodeBase64 b/stump/bin/decodeBase64 index 61a025b..3eff5b2 100755 --- a/stump/bin/decodeBase64 +++ b/stump/bin/decodeBase64 @@ -4,6 +4,7 @@ $isEncoded = 0; $FullHeaders = ""; $DecodedHeaders = ""; $switch = ""; +$inctype = 0; while(<>) { chop; @@ -12,6 +13,12 @@ while(<>) { $FullHeaders .= "$_\n"; + if ( /^\s+/ && $inctype ) { + next; + } + + $inctype=0; + if( /^Content-Transfer-Encoding: BASE64/i ) { $isEncoded = 1; @@ -22,6 +29,9 @@ while(<>) { $isEncoded = 1; $switch = "-q"; # quoted-printable + } elsif( /^Content-Type: /i ) { + $inctype = 1; + } elsif( ! /^Mime-Version: /i && ! /Content-Type: /i ) { $DecodedHeaders .= "$_\n"; } -- 2.30.2