From 33fe3075f50e4632f8a71854bef368889bff217f Mon Sep 17 00:00:00 2001 From: epg <> Date: Sun, 25 Aug 2002 20:02:13 +0000 Subject: [PATCH] (get_headers): Down-case the header name before using it as a key to the hash. --- minc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); -- 2.56.0