1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1999-01-20 04:59:39 +00:00
parent 9c5b1986a3
commit 210367ec88
140 changed files with 25635 additions and 14037 deletions

View file

@ -9,8 +9,6 @@ include Kconv
class String
public :kconv
def kconv(code = Kconv::EUC)
Kconv.kconv(self, code, Kconv::AUTO)
end
@ -32,13 +30,20 @@ if ARGV[0] == '-w'
end
if ARGV.length == 0
user = ENV['USER']
file = ENV['MAIL']
user = ENV['USER'] || ENV['USERNAME'] || ENV['LOGNAME']
else
user = ARGV[0]
file = user = ARGV[0]
ARGV.clear
end
[ENV['SPOOLDIR'], '/usr/spool', '/var/spool', '/usr', '/var'].each do |m|
break if File.exist? ARGV[0] = "#{m}/mail/#{user}"
if file == nil or !File.exist? file
[ENV['SPOOLDIR'], '/usr/spool', '/var/spool', '/usr', '/var'].each do |m|
if File.exist? f = "#{m}/mail/#{user}"
file = f
break
end
end
end
$outcount = 0;
@ -63,18 +68,23 @@ def fromout(date, from, subj)
end
from = from.kconv(lang).kjust(28)
subj = subj.kconv(lang).kjust(40)
printf "%02d/%02d/%02d [%s] %s\n",y,m,d,from,subj
printf "%02d/%02d/%02d [%s] %s\n",y%100,m,d,from,subj
$outcount += 1
end
for file in ARGV
next if !File.exist?(file)
if File.exist?(file)
atime = File.atime(file)
mtime = File.mtime(file)
f = open(file, "r")
while !f.eof?
mail = Mail.new(f)
fromout mail.header['Date'], mail.header['From'], mail.header['Subject']
begin
until f.eof?
mail = Mail.new(f)
fromout mail.header['Date'],mail.header['From'],mail.header['Subject']
end
ensure
f.close
File.utime(atime, mtime, file)
end
f.close
end
if $outcount == 0