From 689899cbecabfc3c59cb4dde354d00a69f05a022 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 17 Oct 2023 20:32:07 +0300 Subject: [PATCH] Fixed cp --- coreutils/cp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreutils/cp.c b/coreutils/cp.c index 428eaee..c863630 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -23,7 +23,7 @@ char *make_path(const char *src, const char *dst) { int write_buffer(int ifd, int ofd) { off_t len = lseek(ifd, 0, SEEK_END); - if (len <= 0) + if (len < 0) return 1; if (ftruncate(ofd, len) < 0) @@ -143,7 +143,7 @@ int main(const int argc, const char **argv) { if (new_path == NULL) return 1; - if (copy(argv[i], new_path)) + if (cptree(argv[i], new_path)) ret = 1; free(new_path);