diff --git a/coreutils/cp.c b/coreutils/cp.c index aff13d5..428eaee 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -99,7 +99,7 @@ int cptree(const char *src, const char *dst) { struct dirent *ep; while ((ep = readdir(dir)) != NULL) { - if (!strcmp(ep->d_name, ".") || !strcmp(ep->d_name, "..")) + if (!strcmp(ep->d_name, ".") || !strcmp(ep->d_name, "..") || !strcmp(dst, ep->d_name)) continue; char *src_path = make_path(src, ep->d_name);