From: epg <> Date: Sun, 25 Aug 2002 20:02:13 +0000 (+0000) Subject: (get_headers): Down-case the header name before using it as a key to X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/33fe3075f50e4632f8a71854bef368889bff217f?ds=inline (get_headers): Down-case the header name before using it as a key to the hash. --- diff --git a/minc b/minc index 8963d4e..4fc8582 100755 --- a/minc +++ b/minc @@ -303,7 +303,8 @@ sub store_message { sub get_headers { my $msg = shift; my %headers; - my $current; # current header, used for unfolding lines + my $current; # current header, used for unfolding lines + my $fieldname; # unmolested header name open(MSG, $msg); while () { @@ -322,13 +323,14 @@ sub get_headers { $headers{$current} .= $_; } else { - ($current) = split(/:/); + ($fieldname) = split(/:/); + $current = lc($fieldname); # XXX: Is it correct simply to eat all whitespace between # the colon and the first text for the header? # Furthermore, is any space at all required? Or is # '^Subject:hey$' a perfectly valid header? - (undef, $headers{$current}) = split(/^$current:\s*/); + (undef, $headers{$current}) = split(/^$fieldname:\s*/); } } close(MSG);