cp: allow copying all files except directories

The old condition seemed odd. This allows taking screen shots by
copying the /dev/fb0.
This commit is contained in:
Bananymous 2023-11-29 16:13:23 +02:00
parent ff550785a7
commit 7090388c70
1 changed files with 2 additions and 2 deletions

View File

@ -18,9 +18,9 @@ bool copy_file(const BAN::String& source, BAN::String destination)
perror("stat");
return false;
}
if (!S_ISREG(st.st_mode))
if (S_ISDIR(st.st_mode))
{
fprintf(stderr, "%s: not a directory\n", source.data());
fprintf(stderr, "%s: is a directory\n", source.data());
return false;
}