Date: Wed, 19 Oct 2022 08:01:37 GMT From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 0821423134b5 - stable/13 - sort: deindent closefile Message-ID: <202210190801.29J81bSF061421@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=0821423134b54ea490882640e956a65e29cf124e commit 0821423134b54ea490882640e956a65e29cf124e Author: Baptiste Daroussin <bapt@FreeBSD.org> AuthorDate: 2022-10-13 08:38:12 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2022-10-19 07:59:30 +0000 sort: deindent closefile (cherry picked from commit f9d9a7cc4f2ff38795e5056721297e2b8442bf7a) --- usr.bin/sort/file.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c index 05058a2509b5..8f9d8ac89b5b 100644 --- a/usr.bin/sort/file.c +++ b/usr.bin/sort/file.c @@ -574,19 +574,17 @@ openfile(const char *fn, const char *mode) void closefile(FILE *f, const char *fn) { - if (f == NULL) { - ; - } else if (f == stdin) { - ; - } else if (f == stdout) { + if (f == NULL || f = stdin) + return; + if (f == stdout) { fflush(f); - } else { - if (file_is_tmp(fn) && compress_program != NULL) { - if(pclose(f)<0) - err(2,NULL); - } else - fclose(f); + return; } + if (file_is_tmp(fn) && compress_program != NULL) { + if(pclose(f)<0) + err(2,NULL); + } else + fclose(f); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210190801.29J81bSF061421>