summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-10 08:44:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-10 08:44:29 +0000
commit997ff23758884944f28a089eaa50ac7eb1c026c6 (patch)
treef99563ed31c2f6a8facc7160cccde602d39af79b /sample
parentd148ffef297193fe5f6639a8bd8c9ee3d3374479 (diff)
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/cal.rb7
-rw-r--r--sample/uumerge.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/sample/cal.rb b/sample/cal.rb
index a5f4b4d..50865db 100644
--- a/sample/cal.rb
+++ b/sample/cal.rb
@@ -1,7 +1,7 @@
#! /usr/local/bin/ruby
-# cal.rb (bsd compatible version): Written by Tadayoshi Funaba 1998
-# $Id: bsdcal.rb,v 1.2 1998/12/01 13:47:40 tadf Exp $
+# cal.rb (bsd compatible version): Written by Tadayoshi Funaba 1998, 1999
+# $Id: bsdcal.rb,v 1.3 1999/02/06 08:52:21 tadf Exp $
require 'date2'
@@ -68,7 +68,7 @@ def zip(xs)
yr
end
-while /^-(.*)$/no =~ $*[0]
+while /^-([^-].*)$/no =~ $*[0]
a = $1
if /^c(.+)?$/no =~ a then
if $1 then
@@ -90,6 +90,7 @@ while /^-(.*)$/no =~ $*[0]
end
$*.shift
end
+$*.shift if /^--/no =~ $*[0]
usage if (gs = $tab[$cc]).nil?
case $*.length
when 0
diff --git a/sample/uumerge.rb b/sample/uumerge.rb
index 26f2892..418323c 100644
--- a/sample/uumerge.rb
+++ b/sample/uumerge.rb
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
if ARGV[0] == "-c"
out_stdout = 1
@@ -18,7 +18,7 @@ while gets()
out = open($file, "w") if $file != ""
end
out.binmode
- next
+ break
end
end