get rid of an unused function

Signed-off-by: Jan Dvořák <mordae@anilinux.org>
improve parsing and do not forget to close the fp

Signed-off-by: Jan Dvořák <mordae@anilinux.org>