Module Name:    src
Committed By:   mrg
Date:           Sun Nov 28 10:45:33 UTC 2010

Modified Files:
        src/usr.bin/hexdump: hexdump.c

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

from mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/hexdump/hexdump.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/hexdump/hexdump.c
diff -u src/usr.bin/hexdump/hexdump.c:1.16 src/usr.bin/hexdump/hexdump.c:1.17
--- src/usr.bin/hexdump/hexdump.c:1.16	Sat Nov 27 20:46:38 2010
+++ src/usr.bin/hexdump/hexdump.c	Sun Nov 28 10:45:32 2010
@@ -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

Reply via email to