From 7d55775e260f0840640d21e14a2856e6fb835ee1 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 23 Jun 2003 00:55:10 +0000 Subject: 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@ --- usr.bin/grep/binary.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/grep/binary.c') 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; -- cgit v1.2.3