Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/hexdump PR/9195: Tanaka Akira: od does not display s...



details:   https://anonhg.NetBSD.org/src/rev/b602b1dc150f
branches:  trunk
changeset: 503841:b602b1dc150f
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Feb 15 18:16:12 2001 +0000

description:
PR/9195: Tanaka Akira: od does not display short files containing nulls. Fix
from Andrew Brown.

diffstat:

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

diffs (28 lines):

diff -r e51c197d980b -r b602b1dc150f usr.bin/hexdump/display.c
--- a/usr.bin/hexdump/display.c Thu Feb 15 17:58:55 2001 +0000
+++ b/usr.bin/hexdump/display.c Thu Feb 15 18:16:12 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: display.c,v 1.9 2000/07/10 10:09:04 itojun Exp $       */
+/*     $NetBSD: display.c,v 1.10 2001/02/15 18:16:12 christos Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)display.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: display.c,v 1.9 2000/07/10 10:09:04 itojun Exp $");
+__RCSID("$NetBSD: display.c,v 1.10 2001/02/15 18:16:12 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -257,7 +257,8 @@
                if (!length || (ateof && !next(NULL))) {
                        if (need == blocksize)
                                return(NULL);
-                       if (vflag != ALL && !memcmp(curp, savp, nread)) {
+                       if (!need && vflag != ALL &&
+                           !memcmp(curp, savp, nread)) {
                                if (vflag != DUP)
                                        (void)printf("*\n");
                                return(NULL);



Home | Main Index | Thread Index | Old Index