diff options
-rw-r--r-- | bin/cat/cat.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 27e29ab6049..07f9d3c3899 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cat.c,v 1.17 2005/04/05 01:18:53 jaredy Exp $ */ +/* $OpenBSD: cat.c,v 1.18 2007/03/22 18:35:07 millert Exp $ */ /* $NetBSD: cat.c,v 1.11 1995/09/07 06:12:54 jtc Exp $ */ /* @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95"; #else -static char rcsid[] = "$OpenBSD: cat.c,v 1.17 2005/04/05 01:18:53 jaredy Exp $"; +static char rcsid[] = "$OpenBSD: cat.c,v 1.18 2007/03/22 18:35:07 millert Exp $"; #endif #endif /* not lint */ @@ -139,7 +139,9 @@ cook_args(char **argv) filename = *argv++; } cook_buf(fp); - if (fp != stdin) + if (fp == stdin) + clearerr(fp); + else (void)fclose(fp); } while (*argv); } |