X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=blobdiff_plain;f=mk_game_results;h=0da4ace49e598619fb369e05208a8e4d135dafbe;hp=d2c3682aa7aa28cde901f8a15931faf2c871cf72;hb=d7b5e8dca433dd93287fc7979b6412dd947523ba;hpb=39513052c4fc30ada0cbc0e4b70753701c893ee5 diff --git a/mk_game_results b/mk_game_results index d2c3682..0da4ace 100755 --- a/mk_game_results +++ b/mk_game_results @@ -5,7 +5,7 @@ # Homepage:: http://sourceforge.jp/projects/shogi-server/ # #-- -# Copyright (C) 2009 Daigo Moriwaki +# Copyright (C) 2009-2012 Daigo Moriwaki # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -58,7 +58,11 @@ require 'getoptlong' # @parameter file an absolute path of a csa file # def grep(file) - str = File.open(file).read + if RUBY_VERSION >= "1.9.1" + str = File.open(file, "r:EUC-JP").read + else + str = File.open(file, "r").read + end if /^N\+(.*)$/ =~ str then black_name = $1.strip end if /^N\-(.*)$/ =~ str then white_name = $1.strip end @@ -89,6 +93,7 @@ def grep(file) puts [time, state, black_mark, black_id, white_id, white_mark, file].join("\t") end end + $stdout.flush end # Show Usage