improved basename.c