summaryrefslogtreecommitdiff
path: root/usr.bin/grep/binary.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-06-23 00:55:10 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-06-23 00:55:10 +0000
commit7d55775e260f0840640d21e14a2856e6fb835ee1 (patch)
treec2b7e31a9f52d02f3a226791d30959978c8d50a9 /usr.bin/grep/binary.c
parent5b3fcdbe0251a659d3afc9b2028881d9181c820b (diff)
better detetection/handling of binary files.
make -a do the right thing, doc and implement -U, -I. add --help and --mmap for compatibility. some other minor fixes. some from NetBSD. ok deraadt@
Diffstat (limited to 'usr.bin/grep/binary.c')
-rw-r--r--usr.bin/grep/binary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/grep/binary.c b/usr.bin/grep/binary.c
index 360d142f4bd..e8ff9188fd8 100644
--- a/usr.bin/grep/binary.c
+++ b/usr.bin/grep/binary.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: binary.c,v 1.4 2003/06/22 22:38:50 deraadt Exp $ */
+/* $OpenBSD: binary.c,v 1.5 2003/06/23 00:55:09 tedu Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -83,7 +83,7 @@ mmbin_file(mmf_t *f)
/* XXX knows too much about mmf internals */
for (i = 0; i < BUFFER_SIZE && i < f->len; i++)
- if (!isprint(f->base[i]))
+ if (!isprint(f->base[i]) && !isspace(f->base[i]))
return 1;
mmrewind(f);
return 0;