[PATCH] introduce and use xmalloc_fgets/fgetline