patch eof_ending cs