Skip to content

Commit 9f891d0

Browse files
authored
ed: -s silences warning in edEdit() (#767)
* 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
1 parent 715e441 commit 9f891d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/ed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ sub edPrintBin { edPrint($PRINT_BIN); }
462462
sub edQuitAsk { edQuit(1); }
463463
sub edAppend { edInsert(1); }
464464
sub edWriteAppend { edWrite(1); }
465-
sub edEditAsk { edEdit($QUESTIONS_MODE,$NO_INSERT_MODE); }
465+
sub edEditAsk { edEdit(!$SupressCounts, $NO_INSERT_MODE); }
466466
sub edRead { edEdit($QUESTIONS_MODE,$INSERT_MODE); }
467467

468468
#
@@ -1201,7 +1201,7 @@ By default no prompt is displayed.
12011201
12021202
=item -s
12031203
1204-
Suppress byte counts
1204+
Suppress byte counts and diagnostics
12051205
12061206
=back
12071207

0 commit comments

Comments
 (0)