From e8b2cd028266f23152f8df28ba0e498845d0b2b2 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Wed, 20 Sep 2023 01:18:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(`c`):=20wrong=20exit=20code=20with=20`-q`?= =?UTF-8?q?=20option=20=F0=9F=90=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/c b/bin/c index fede96a2..7faf5487 100755 --- a/bin/c +++ b/bin/c @@ -141,10 +141,11 @@ copy() { catThenCopy() { local content content="$(cat)" - { + if $keep_eol; then + printf '%s\n' "$content" + else printf %s "$content" - $keep_eol && echo - } | copy + fi | copy } teeAndCopy() {