diff --git a/toys/other/shred.c b/toys/other/shred.c index 4e56ce4924a3755e7eacfba66dc192ecdecd01d8..964ce7d659f07c1a26b7e195fc3b3c53dae5497f 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 d0842bdbdc92cd8082ce60ef571bf2b7bae76805..45ca89b547075b5e6ab2298461f2163284beddee 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 ea0fb7db9a0227991cf172bc3b2e9db63aa35948..0da8da6aa8c2c2d396b3d42fe46f2b39943859f5 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 60e7a33fe564ae294a3828eecac91736ced469ab..63dda31f04e54c1900281030988b017632648168 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 {