diff: always properly kill pr(1)

When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.

Submitted by:	Bret Ketchum
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26232
This commit is contained in:
Baptiste Daroussin 2020-09-01 14:52:39 +00:00
parent 5d9b05ac30
commit fb0d1c6980

View File

@ -412,10 +412,10 @@ diffreg(char *file1, char *file2, int flags, int capsicum)
ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew));
check(f1, f2, flags);
output(file1, f1, file2, f2, flags);
if (pr != NULL)
stop_pr(pr);
closem:
if (pr != NULL)
stop_pr(pr);
if (anychange) {
status |= 1;
if (rval == D_SAME)
@ -1704,4 +1704,4 @@ print_space(int nc, int n, int flags) {
}
}
diff_output("%*s", col, "");
}
}