Fixed recursion in cp
This commit is contained in:
parent
90d49dd3cf
commit
71b98e52d8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user