fixed and improved brokensymlinks in C