chiark
/
gitweb
/
~webstump
/
modbot-urcm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
7ce8af7
)
Merge branch 'master' of ../live-mtm
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 10 Oct 2014 12:03:56 +0000
(13:03 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 10 Oct 2014 12:03:56 +0000
(13:03 +0100)
stump/bin/decodeBase64
patch
|
blob
|
history
diff --git
a/stump/bin/decodeBase64
b/stump/bin/decodeBase64
index 61a025b3b19924a536494c1099039a0aca7dd5b1..3eff5b240115833098acfe984d2d80cd19e5c8f9 100755
(executable)
--- 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";
}