NetBSD Problem Report #44156

From asau@inbox.ru  Fri Nov 26 23:59:05 2010
Return-Path: <asau@inbox.ru>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id D5E8863B95F
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 26 Nov 2010 23:59:05 +0000 (UTC)
Message-Id: <8762vj7nph.fsf@inbox.ru>
Date: Sat, 27 Nov 2010 00:57:14 +0300
From: Aleksej Saushev <asau@inbox.ru>
Reply-To: asau@inbox.ru
To: gnats-bugs@gnats.NetBSD.org
Subject: "od -?" prints usage for "hexdump" rather than "od"

>Number:         44156
>Category:       bin
>Synopsis:       "od -?" prints usage for "hexdump" rather than "od"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 27 00:00:00 +0000 2010
>Closed-Date:    Sat Nov 27 00:57:30 +0000 2010
>Last-Modified:  Sat Nov 27 01:00:16 +0000 2010
>Originator:     asau@inbox.ru
>Release:        NetBSD 5.99.40
>Organization:
HE CE3OH...
>Environment:
System: NetBSD lithium 5.99.40 NetBSD 5.99.40 (GENERIC) #0: Fri Nov 26 03:14:35 MSK 2010 asau@lithium:/usr/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	od: unknown option -- ?
	hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]

	"od" has another set of flags, one can't guess them from "hexdump" usage.
>How-To-Repeat:
	od -?
>Fix:
	None yet.

>Release-Note:

>Audit-Trail:
From: Aleksej Saushev <asau@inbox.ru>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/44156: "od -?" prints usage for "hexdump" rather than "od"
Date: Sat, 27 Nov 2010 03:42:40 +0300

 --- usr.bin/hexdump/odsyntax.c	9 Feb 2010 14:06:37 -0000	1.26
 +++ usr.bin/hexdump/odsyntax.c	26 Nov 2010 23:02:52 -0000
 @@ -73,6 +73,18 @@
  static void odoffset(int, char ***);
  static void posixtypes(char const *);

 +static void od_usage(void);
 +
 +static void
 +od_usage(void)
 +{
 +	(void)fprintf(stderr,
 +"usage: od [-aBbcDdeFfHhIiLlOovXx] [-A base] [-j skip] [-N length]\n"
 +"          [-t type_string] [[+]offset[.][Bb]] [file ...]\n"
 +	);
 +	exit(1);
 +}
 +
  void
  odsyntax(int argc, char ***argvp)
  {
 @@ -176,7 +188,7 @@
  			break;
  		case '?':
  		default:
 -			usage();
 +			od_usage();
  		}

  	if (fshead->nextfs->nextfs == NULL)
 @@ -246,7 +258,7 @@
  				default:
  					warnx("Bad type-size qualifier '%c'",
  					    *type_string);
 -					usage();
 +					od_usage();
  				}
  				type_string++;
  			} else if (isdigit((unsigned char)*type_string)) {
 @@ -276,7 +288,7 @@
  				default:
  					warnx("Bad type-size qualifier '%c'",
  					    *type_string);
 -					usage();
 +					od_usage();
  				}
  				type_string++;
  			} else if (isdigit((unsigned char)*type_string)) {
 @@ -286,7 +298,7 @@
  				nbytes = 4;
  			break;
  		default:
 -			usage();
 +			od_usage();
  		}
  		for (odf = odftab; odf->type != 0; odf++)
  			if (odf->type == type && odf->nbytes == nbytes)

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44156 CVS commit: src/usr.bin/hexdump
Date: Sat, 27 Nov 2010 00:42:58 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sat Nov 27 00:42:58 UTC 2010

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

 Log Message:
 PR 44156: od -? prints usage for "hexdump" rather than "od"


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

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

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 27 Nov 2010 00:57:30 +0000
State-Changed-Why:
fixed, thanks


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/44156: "od -?" prints usage for "hexdump" rather than "od"
Date: Sat, 27 Nov 2010 00:57:06 +0000

 On Sat, Nov 27, 2010 at 12:45:07AM +0000, Aleksej Saushev wrote:
  >  --- usr.bin/hexdump/odsyntax.c	9 Feb 2010 14:06:37 -0000	1.26
  >  +++ usr.bin/hexdump/odsyntax.c	26 Nov 2010 23:02:52 -0000

 Sorry, not fast enough :-)

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.