ed: Don't undo commands in sigint

If newcmd is 0 then error() undo all the modifications
that happened since the last command, but this is  not
what POSIX mandates:

SIGINT	The ed utility shall interrupt its current activity, write the
	string "?\n" to standard output, and return to command mode
	(see the EXTENDED DESCRIPTION section).
This commit is contained in:
Roberto E. Vargas Caballero 2023-12-28 17:26:50 +01:00
parent bbdd7bedc4
commit 6a557314b9
1 changed files with 1 additions and 0 deletions

1
ed.c
View File

@ -740,6 +740,7 @@ chksignals(void)
if (intr) {
intr = 0;
newcmd = 1;
clearerr(stdin);
error("Interrupt");
}