summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-16 06:05:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-16 06:05:46 +0000
commitb0edb6968fecaa368d2980f0572e6c7cd203e734 (patch)
treefffb60aa130f9c80a26bbe2141485a5ae4540225 /sample
parentd18d1cea2ec069a98b803533d4f43b7252276ce5 (diff)
pass_block, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@74 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/from.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/sample/from.rb b/sample/from.rb
index ce69108529..0a83f081f1 100644
--- a/sample/from.rb
+++ b/sample/from.rb
@@ -32,13 +32,15 @@ end
if ARGV.length == 0
user = ENV['USER']
else
- user = ARGV[0]
+ file = user = ARGV[0]
ARGV.clear
end
-file = ARGV[0]
[ENV['SPOOLDIR'], '/usr/spool', '/var/spool', '/usr', '/var'].each do |m|
- break if File.exist? file = "#{m}/mail/#{user}"
+ if File.exist? f = "#{m}/mail/#{user}"
+ file = f
+ break
+ end
end
$outcount = 0;
@@ -63,7 +65,7 @@ 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