EOF handling for stdin