From 1d2ddbabd3f133705f6256225fc5098864827e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 31 Jul 2025 03:06:32 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B7=AE=E5=BC=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- toys/other/shred.c | 2 +- toys/posix/pwd.c | 2 +- toys/posix/split.c | 2 +- toys/posix/tee.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/toys/other/shred.c b/toys/other/shred.c index 4e56ce4..964ce7d 100644 --- a/toys/other/shred.c +++ b/toys/other/shred.c @@ -99,6 +99,6 @@ void shred_main(void) pos += throw; } if (toys.optflags & FLAG_u) - if (unlink(*try) && unlink(*try)) perror_msg("unlink '%s'", *try); + if (unlink(*try)) perror_msg("unlink '%s'", *try); } } diff --git a/toys/posix/pwd.c b/toys/posix/pwd.c index d0842bd..45ca89b 100644 --- a/toys/posix/pwd.c +++ b/toys/posix/pwd.c @@ -46,7 +46,7 @@ void pwd_main(void) } else s = NULL; // If -L didn't give us a valid path, use cwd. - if (!s && (s = pwd)) perror_exit("xgetcwd"); + if (!s && !(s = pwd)) perror_exit("xgetcwd"); xprintf("%s\n", s); if (CFG_TOYBOX_FREE) free(pwd); diff --git a/toys/posix/split.c b/toys/posix/split.c index ea0fb7d..0da8da6 100644 --- a/toys/posix/split.c +++ b/toys/posix/split.c @@ -8,7 +8,7 @@ * - should splitting an empty file produce an empty outfile? (Went with "no".) * - permissions on output file -USE_SPLIT(NEWTOY(split, ">2a#<1=2>9b#<1l#<1[!b]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_SPLIT(NEWTOY(split, ">2a#<1=2>9b#<1l#<1[!bl]", TOYFLAG_USR|TOYFLAG_BIN)) config SPLIT bool "split" diff --git a/toys/posix/tee.c b/toys/posix/tee.c index 60e7a33..63dda31 100644 --- a/toys/posix/tee.c +++ b/toys/posix/tee.c @@ -24,6 +24,7 @@ config TEE GLOBALS( void *outputs; + int out; ) struct fd_list { -- Gitee