From 7090388c706795993b764e9779e785b46673fa43 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 29 Nov 2023 16:13:23 +0200 Subject: [PATCH] cp: allow copying all files except directories The old condition seemed odd. This allows taking screen shots by copying the /dev/fb0. --- userspace/cp/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userspace/cp/main.cpp b/userspace/cp/main.cpp index bfd2a8a8f6..58d8a5c092 100644 --- a/userspace/cp/main.cpp +++ b/userspace/cp/main.cpp @@ -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; }