[PATCH] fix bugs in dump_dir.c