compat function for getline using fgetln