X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=Engine.pm;h=6ec914fb42c8bf7e98909d36e9c5a7aebf1fad4a;hp=4d05750e187546e301b27319766cb2a9e0ce6322;hb=66ad31721419c43f68a96a30e55eea6132588fba;hpb=95bd22317a24c2d94289a16afb68100218a2bd31 diff --git a/Engine.pm b/Engine.pm index 4d05750..6ec914f 100644 --- a/Engine.pm +++ b/Engine.pm @@ -29,6 +29,7 @@ sub open { ev => $ev, cb => $cb, seen_uciok => 0, + stopping => 0, }; print $uciwrite "uci\n"; @@ -46,7 +47,7 @@ sub _anyevent_handle_line { if (!$engine->{'seen_uciok'}) { # Gobble up lines until we see uciok. - if ($line =~ /^id (\S+) (.*)$/) { + if ($line =~ /^id (\S+) (.*?)\s*$/) { $engine->{'id'}->{$1} = $2; } elsif ($line =~ /^uciok$/) { $engine->{'seen_uciok'} = 1;