OSDN Git Service

File.expand_path should be peformed before File.directory? check
authorbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Sat, 9 Aug 2008 15:31:54 +0000 (15:31 +0000)
committerbeatles <beatles@b8c68f68-1e22-0410-b08e-880e1f8202b4>
Sat, 9 Aug 2008 15:31:54 +0000 (15:31 +0000)
shogi-server

index 483e443..ebca314 100755 (executable)
@@ -191,14 +191,14 @@ def main
     usage
     exit 2
   end
     usage
     exit 2
   end
+  if $options["player-log-dir"]
+    $options["player-log-dir"] = File.expand_path($options["player-log-dir"])
+  end
   if $options["player-log-dir"] && 
   if $options["player-log-dir"] && 
-     !File.exists?($options["player-log-dir"])
+     !File.directory?($options["player-log-dir"])
     usage
     exit 3
   end
     usage
     exit 3
   end
-  if $options["player-log-dir"]
-    $options["player-log-dir"] = File.expand_path($options["player-log-dir"])
-  end
 
   LEAGUE.event = ARGV.shift
   port = ARGV.shift
 
   LEAGUE.event = ARGV.shift
   port = ARGV.shift