From nobody@FreeBSD.org  Thu Feb 21 19:08:45 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id D8CEC3E3
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 21 Feb 2013 19:08:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id CB182247
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 21 Feb 2013 19:08:45 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r1LJ8jBR094065
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 21 Feb 2013 19:08:45 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r1LJ8jK1094064;
	Thu, 21 Feb 2013 19:08:45 GMT
	(envelope-from nobody)
Message-Id: <201302211908.r1LJ8jK1094064@red.freebsd.org>
Date: Thu, 21 Feb 2013 19:08:45 GMT
From: Glen Barber <gjb@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] dc(1) - Properly handle '-h' argument
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176332
>Category:       bin
>Synopsis:       [patch] dc(1) - Properly handle '-h' argument
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gjb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 21 19:10:01 UTC 2013
>Closed-Date:    Sun Mar 03 00:38:12 UTC 2013
>Last-Modified:  Sun Mar  3 00:40:00 UTC 2013
>Originator:     Glen Barber
>Release:        10.0-CURRENT r246768
>Organization:
>Environment:
FreeBSD nucleus 10.0-CURRENT FreeBSD 10.0-CURRENT #60 r246768: Wed Feb 13 14:55:15 EST 2013     root@nucleus:/usr/obj/usr/src/sys/NUCLEUS  amd64

>Description:
dc(1) manual page advertises '-h' and '--help' as valid arguments, however 'h' is not in the getopt_long() list.

gjb@nucleus:~ % dc -h
dc: invalid option -- h
usage: dc [-hVx] [-e expression] [file]

>How-To-Repeat:

>Fix:
Patch is attached.

Patch attached with submission follows:

Index: usr.bin/dc/dc.c
===================================================================
--- usr.bin/dc/dc.c	(revision 247114)
+++ usr.bin/dc/dc.c	(working copy)
@@ -84,7 +84,7 @@
 	bool extended_regs = false, preproc_done = false;
 
 	/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
-	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
+	while ((ch = getopt_long(argc, argv, "e:f:hVx", long_options, NULL)) != -1) {
 		switch (ch) {
 		case 'e':
 			if (!preproc_done)


>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/176332: commit references a PR
Date: Thu, 28 Feb 2013 01:22:21 +0000 (UTC)

 Author: gjb (doc,ports committer)
 Date: Thu Feb 28 01:22:14 2013
 New Revision: 247441
 URL: http://svnweb.freebsd.org/changeset/base/247441
 
 Log:
   Properly handle '-h' argument.
   
   PR:		176332
   Reviewed by:	scottl
   MFC after:	3 days
 
 Modified:
   head/usr.bin/dc/dc.c
 
 Modified: head/usr.bin/dc/dc.c
 ==============================================================================
 --- head/usr.bin/dc/dc.c	Thu Feb 28 01:05:48 2013	(r247440)
 +++ head/usr.bin/dc/dc.c	Thu Feb 28 01:22:14 2013	(r247441)
 @@ -84,7 +84,7 @@ main(int argc, char *argv[])
  	bool extended_regs = false, preproc_done = false;
  
  	/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
 -	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
 +	while ((ch = getopt_long(argc, argv, "e:f:hVx", long_options, NULL)) != -1) {
  		switch (ch) {
  		case 'e':
  			if (!preproc_done)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: gjb 
State-Changed-When: Sun Mar 3 00:37:45 UTC 2013 
State-Changed-Why:  
Change committed. 



Responsible-Changed-From-To: freebsd-bugs->gjb 
Responsible-Changed-By: gjb 
Responsible-Changed-When: Sun Mar 3 00:37:45 UTC 2013 
Responsible-Changed-Why:  
I closed it. 


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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/176332: commit references a PR
Date: Sun,  3 Mar 2013 00:37:43 +0000 (UTC)

 Author: gjb (doc,ports committer)
 Date: Sun Mar  3 00:37:34 2013
 New Revision: 247677
 URL: http://svnweb.freebsd.org/changeset/base/247677
 
 Log:
   MFC r247441:
   Properly handle '-h' argument.
   
   PR:		176332
 
 Modified:
   stable/9/usr.bin/dc/dc.c
 Directory Properties:
   stable/9/usr.bin/dc/   (props changed)
 
 Modified: stable/9/usr.bin/dc/dc.c
 ==============================================================================
 --- stable/9/usr.bin/dc/dc.c	Sat Mar  2 23:40:42 2013	(r247676)
 +++ stable/9/usr.bin/dc/dc.c	Sun Mar  3 00:37:34 2013	(r247677)
 @@ -84,7 +84,7 @@ main(int argc, char *argv[])
  	bool extended_regs = false, preproc_done = false;
  
  	/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
 -	while ((ch = getopt_long(argc, argv, "e:f:Vx", long_options, NULL)) != -1) {
 +	while ((ch = getopt_long(argc, argv, "e:f:hVx", long_options, NULL)) != -1) {
  		switch (ch) {
  		case 'e':
  			if (!preproc_done)
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
