bugfix to readline(Pipe) for non-stdin