From 24a9eac76cd53c372d47b8e382ef059c984de336 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:16:49 +0800 Subject: [PATCH] ed: -s silences warning in edEdit() * Go with the BSD treatment of -s flag: allow e command to open a new file (replacing the line buffer) without warning if the buffer was modified * This is more correct because in script mode (-s) ed is not being used interactively * This difference was discovered when testing OpenBSD version --- bin/ed | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ed b/bin/ed index 03aab144..59424c5b 100755 --- a/bin/ed +++ b/bin/ed @@ -462,7 +462,7 @@ sub edPrintBin { edPrint($PRINT_BIN); } sub edQuitAsk { edQuit(1); } sub edAppend { edInsert(1); } sub edWriteAppend { edWrite(1); } -sub edEditAsk { edEdit($QUESTIONS_MODE,$NO_INSERT_MODE); } +sub edEditAsk { edEdit(!$SupressCounts, $NO_INSERT_MODE); } sub edRead { edEdit($QUESTIONS_MODE,$INSERT_MODE); } # @@ -1201,7 +1201,7 @@ By default no prompt is displayed. =item -s -Suppress byte counts +Suppress byte counts and diagnostics =back