diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-01-20 04:59:39 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-01-20 04:59:39 +0000 |
| commit | a2af08da0c33d2dcde870b491f62a8bd0c1c6b81 (patch) | |
| tree | feb35473da45947378fbc02defe39bcd79ef600e /lib/mailread.rb | |
| parent | c5f4657aaa8a92db27dc722dee741f1b8e0da809 (diff) | |
| download | ruby-a2af08da0c33d2dcde870b491f62a8bd0c1c6b81.tar.gz ruby-a2af08da0c33d2dcde870b491f62a8bd0c1c6b81.tar.xz ruby-a2af08da0c33d2dcde870b491f62a8bd0c1c6b81.zip | |
This commit was generated by cvs2svn to compensate for changes in r372,
which included commits to RCS files with non-trunk default branches.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mailread.rb')
| -rw-r--r-- | lib/mailread.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mailread.rb b/lib/mailread.rb index a5d60c84b..5e46606c0 100644 --- a/lib/mailread.rb +++ b/lib/mailread.rb @@ -1,7 +1,7 @@ class Mail def initialize(f) - unless f.kind_of?(IO) + unless defined? f.gets f = open(f, "r") opened = true end @@ -15,7 +15,8 @@ class Mail break if /^$/ # end of header if /^(\S+):\s*(.*)/ - @header[attr = $1.capitalize!] = $2 + (attr = $1).capitalize! + @header[attr] = $2 elsif attr sub!(/^\s*/, '') @header[attr] += "\n" + $_ |
