reverse stdin patch