From nobody@www.freebsd.org  Wed May 29 21:40:42 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id D7C9037B405
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 29 May 2002 21:40:41 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g4U4efhG065709
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 29 May 2002 21:40:41 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g4U4efYH065708;
	Wed, 29 May 2002 21:40:41 -0700 (PDT)
Message-Id: <200205300440.g4U4efYH065708@www.freebsd.org>
Date: Wed, 29 May 2002 21:40:41 -0700 (PDT)
From: Pete Zaitcev <zaitcev@redhat.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mptable should complain about garbage arguments
X-Send-Pr-Version: www-1.0

>Number:         38727
>Category:       bin
>Synopsis:       [patch] mptable(1) should complain about garbage arguments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          analyzed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 29 21:50:01 PDT 2002
>Closed-Date:    
>Last-Modified:  Fri Nov 19 00:00:28 UTC 2010
>Originator:     Pete Zaitcev
>Release:        -current
>Organization:
Red Hat, Inc.
>Environment:
>Description:
      mptable ignores arguments with matching first letters.
>How-To-Repeat:
      
>Fix:
      

*** fbsd-current/mptable.c	Wed May 29 16:32:00 2002
--- ./mptable.c	Wed May 29 21:25:39 2002
***************
*** 327,345 ****
  	    if ( strcmp( optarg, "mesg") == 0 )
  	        dmesg = 1;
  	    else
! 	        dmesg = 0;
  	    break;
  	case 'h':
! 	    if ( strcmp( optarg, "elp") == 0 )
! 	        usage();
! 	    break;
  	case 'g':
  	    if ( strcmp( optarg, "rope") == 0 )
  	        grope = 1;
  	    break;
  	case 'v':
  	    if ( strcmp( optarg, "erbose") == 0 )
  	        verbose = 1;
  	    break;
  	default:
  	    usage();
--- 376,396 ----
  	    if ( strcmp( optarg, "mesg") == 0 )
  	        dmesg = 1;
  	    else
! 		usage();
  	    break;
  	case 'h':
! 	    usage();
  	case 'g':
  	    if ( strcmp( optarg, "rope") == 0 )
  	        grope = 1;
+ 	    else
+ 		usage();
  	    break;
  	case 'v':
  	    if ( strcmp( optarg, "erbose") == 0 )
  	        verbose = 1;
+ 	    else
+ 		usage();
  	    break;
  	default:
  	    usage();

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: arundel 
State-Changed-When: Thu Nov 18 23:31:29 UTC 2010 
State-Changed-Why:  
Can somebody please commit this patch? I'll send in an updated version which 
applies cleanly to HEAD right away. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38727 

From: Alexander Best <arundel@freebsd.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: bin/38727: [patch] mptable(1) should complain about garbage arguments
Date: Thu, 18 Nov 2010 23:53:39 +0000

 --+QahgC5+KEYLbs62
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 here's an updated patch which applies cleanly to HEAD.
 
 cheers.
 alex
 
 -- 
 a13x
 
 --+QahgC5+KEYLbs62
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="mptable.c.diff"
 
 diff --git a/usr.sbin/mptable/mptable.c b/usr.sbin/mptable/mptable.c
 index a16a1b9..b461e61 100644
 --- a/usr.sbin/mptable/mptable.c
 +++ b/usr.sbin/mptable/mptable.c
 @@ -322,20 +322,21 @@ main( int argc, char *argv[] )
  	    if ( strcmp( optarg, "mesg") == 0 )
  	        dmesg = 1;
  	    else
 -	        dmesg = 0;
 -	    break;
 -	case 'h':
 -	    if ( strcmp( optarg, "elp") == 0 )
 -	        usage();
 +		usage();
  	    break;
  	case 'g':
  	    if ( strcmp( optarg, "rope") == 0 )
  	        grope = 1;
 +	    else
 +		usage();
  	    break;
  	case 'v':
  	    if ( strcmp( optarg, "erbose") == 0 )
  	        verbose = 1;
 +	    else
 +		usage();
  	    break;
 +	case 'h':
  	default:
  	    usage();
  	}
 
 --+QahgC5+KEYLbs62--
>Unformatted:
