summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
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 a5f4b4db18..50865dbb8f 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 26f28923d5..418323c439 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