Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/hexdump properly detect that we aren't od(1) and act...



details:   https://anonhg.NetBSD.org/src/rev/215dc3306612
branches:  trunk
changeset: 759102:215dc3306612
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Nov 28 10:45:32 2010 +0000

description:
properly detect that we aren't od(1) and act as hexdump.  fixes hexdump,
which also broke startx (second time this week!)

from mlelstv.

diffstat:

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

diffs (31 lines):

diff -r f0e8e993e284 -r 215dc3306612 usr.bin/hexdump/hexdump.c
--- a/usr.bin/hexdump/hexdump.c Sun Nov 28 09:06:16 2010 +0000
+++ b/usr.bin/hexdump/hexdump.c Sun Nov 28 10:45:32 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hexdump.c,v 1.16 2010/11/27 20:46:38 christos Exp $    */
+/*     $NetBSD: hexdump.c,v 1.17 2010/11/28 10:45:32 mrg Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)hexdump.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: hexdump.c,v 1.16 2010/11/27 20:46:38 christos Exp $");
+__RCSID("$NetBSD: hexdump.c,v 1.17 2010/11/28 10:45:32 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -68,7 +68,11 @@
 
        setlocale(LC_ALL, "");
 
-       isod = (p = strrchr(argv[0], 'o')) == NULL || strcmp(p, "od") == 0;
+       isod = 0;
+       p = strrchr(argv[0], 'o');
+       if (p != NULL && strcmp(p, "od") == 0)
+               isod = 1;
+
        if (isod)
                odsyntax(argc, &argv);
        else



Home | Main Index | Thread Index | Old Index