Skip to content

Commit dad526f

Browse files
authored
fish: loop on eof
* When redirecting input from a file I noticed that fish reads past eof in the playguess() prompt loop * This change is similar to commit 57c92da for bin/moo
1 parent 9c0e086 commit dad526f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/fish

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ sub playguess {
6767

6868
do {
6969
print "\nYou ask me for: ";
70-
$guess=<STDIN>; chomp($guess);
70+
$guess = <STDIN>;
71+
exit unless defined $guess;
72+
chomp $guess;
7173
} while(! defined ($stat=askfor(\@PLAYERS_HAND, \@COMPUTERS_HAND, $guess)));
7274

7375
# Professional mode....is watching you.

0 commit comments

Comments
 (0)