do not double append / to path
fix a bug in dir.c