1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01: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

@ -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;