1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-30 19:20:53 +02:00

25910: avoid dangling file handle in bin_print.

This commit is contained in:
Clint Adams 2008-10-18 14:13:15 +00:00
parent 52fba13e9b
commit 802cdd4f5e
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2008-10-18 Clint Adams <clint@zsh.org>
* 25910: Src/builtin.c: avoid dangling file handle in bin_print.
2008-10-17 Peter Stephenson <pws@csr.com>
* Rocky: 25907: Test/Makefile.in: makefile needs .exe

View file

@ -3689,8 +3689,11 @@ bin_print(char *name, char **args, Options ops, int func)
if (OPT_ISSET(ops,'o') || OPT_ISSET(ops,'O')) {
int flags;
if (fmt && !*args)
if (fmt && !*args) {
if (fout != stdout)
fclose(fout);
return 0;
}
flags = OPT_ISSET(ops,'i') ? SORTIT_IGNORING_CASE : 0;
if (OPT_ISSET(ops,'O'))
flags |= SORTIT_BACKWARDS;