[FOLD] reset error code on eof