Skip to content

Commit

Permalink
ed: -s silences warning in edEdit() (#767)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mknos authored Oct 22, 2024
1 parent 715e441 commit 9f891d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/ed
Original file line number Diff line number Diff line change
Expand Up @@ -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); }

#
Expand Down Expand Up @@ -1201,7 +1201,7 @@ By default no prompt is displayed.
=item -s
Suppress byte counts
Suppress byte counts and diagnostics
=back
Expand Down

0 comments on commit 9f891d0

Please sign in to comment.