aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--lib/un.rb7
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 783160c417..6efce208ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-Fri Jun 25 05:49:14 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Jun 25 06:14:47 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/un.rb (setup): fix of word splitting. [ruby-dev:41723]
diff --git a/lib/un.rb b/lib/un.rb
index 907b80c0ab..1c52c2f469 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -45,7 +45,8 @@ def setup(options = "", *long_options)
long_options.each do |s|
opt_name, arg_name = s.split(/(?=[\s=])/, 2)
opt_name.sub!(/\A--/, '')
- s = "--#{opt_name.gsub(/([A-Za-z]+)([A-Z])/, '\1-\2').downcase}#{arg_name}"
+ s = "--#{opt_name.gsub(/([A-Z]+|[a-z])([A-Z])/, '\1-\2').downcase}#{arg_name}"
+ puts "#{opt_name}=>#{s}" if $DEBUG
opt_name = opt_name.intern
o.on(s) do |val|
opt_hash[opt_name] = val
@@ -307,7 +308,9 @@ def httpd
|argv, options|
require 'webrick'
opt = options[:RequestTimeout] and options[:RequestTimeout] = opt.to_i
- opt = options[:Port] and (options[:Port] = Integer(opt)) rescue nil
+ [:Port, :MaxClients].each do |name|
+ opt = options[name] and (options[name] = Integer(opt)) rescue nil
+ end
unless argv.empty?
options[:DocumentRoot] = argv.shift
end