Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/cat don't use the "f" flag to fopen when -f is not speci...



details:   https://anonhg.NetBSD.org/src/rev/2e38e2a2fc8d
branches:  trunk
changeset: 495543:2e38e2a2fc8d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jul 31 02:49:28 2000 +0000

description:
don't use the "f" flag to fopen when -f is not specified (from Chuck Cranor)

diffstat:

 bin/cat/cat.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r c6ab57713e85 -r 2e38e2a2fc8d bin/cat/cat.c
--- a/bin/cat/cat.c     Mon Jul 31 02:14:47 2000 +0000
+++ b/bin/cat/cat.c     Mon Jul 31 02:49:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cat.c,v 1.23 2000/04/14 05:52:56 simonb Exp $  */
+/*     $NetBSD: cat.c,v 1.24 2000/07/31 02:49:28 christos Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -47,7 +47,7 @@
 #if 0
 static char sccsid[] = "@(#)cat.c      8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: cat.c,v 1.23 2000/04/14 05:52:56 simonb Exp $");
+__RCSID("$NetBSD: cat.c,v 1.24 2000/07/31 02:49:28 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -140,7 +140,8 @@
                if (*argv) {
                        if (!strcmp(*argv, "-"))
                                fp = stdin;
-                       else if ((fp = fopen(*argv, "rf")) == NULL) {
+                       else if ((fp = fopen(*argv,
+                           fflag ? "rf" : "r")) == NULL) {
                                warn("%s", *argv);
                                rval = 1;
                                ++argv;



Home | Main Index | Thread Index | Old Index