diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 1996-04-10 22:21:01 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 1996-04-10 22:21:01 +0000 |
commit | a0d038a40692e0f6d4c1444ca99d69951eb76299 (patch) | |
tree | c1bccc60fab7353150cadcb1f7cec2d7c9cdb399 /usr.bin/wc | |
parent | 6d4bca5b8ae4b0084e8a3aef73621ebc5c0c96d6 (diff) | |
download | src-a0d038a40692e0f6d4c1444ca99d69951eb76299.tar.gz src-a0d038a40692e0f6d4c1444ca99d69951eb76299.zip |
Do not exit if a file is not readable. This is a short hack
until someone rewrite wc(1).
Notes
Notes:
svn path=/head/; revision=15179
Diffstat (limited to 'usr.bin/wc')
-rw-r--r-- | usr.bin/wc/wc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index 1f1c9b3439bc..abc258b39caa 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -129,8 +129,10 @@ cnt(file) fd = STDIN_FILENO; linect = wordct = charct = 0; if (file) { - if ((fd = open(file, O_RDONLY, 0)) < 0) - err("%s: %s", file, strerror(errno)); + if ((fd = open(file, O_RDONLY, 0)) < 0) { + warn("%s", file); + return; + } if (doword) goto word; /* |