From nobody@FreeBSD.org  Wed May  8 15:52:44 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 69810962
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  8 May 2013 15:52:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.FreeBSD.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C28DA0E
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  8 May 2013 15:52:44 +0000 (UTC)
Received: from oldred.FreeBSD.org ([127.0.1.6])
	by oldred.FreeBSD.org (8.14.5/8.14.5) with ESMTP id r48FqiVa085899
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 8 May 2013 15:52:44 GMT
	(envelope-from nobody@oldred.FreeBSD.org)
Received: (from nobody@localhost)
	by oldred.FreeBSD.org (8.14.5/8.14.5/Submit) id r48FqiFC085898;
	Wed, 8 May 2013 15:52:44 GMT
	(envelope-from nobody)
Message-Id: <201305081552.r48FqiFC085898@oldred.FreeBSD.org>
Date: Wed, 8 May 2013 15:52:44 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] don't be picky about case with yes/no prompt in growfs(8)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         178422
>Category:       bin
>Synopsis:       [PATCH] don't be picky about case with yes/no prompt in growfs(8)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 08 16:00:00 UTC 2013
>Closed-Date:    Tue Jun 25 19:40:53 UTC 2013
>Last-Modified:  Tue Jun 25 20:10:06 UTC 2013
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r+6a3d3f6-dirty: Sat Apr 27 16:03:39 PDT 2013     root@fuji-current.local:/usr/obj/usr/src/sys/FUJI  i386
>Description:
The attached patch changes the prompt check from strcmp to strcasecmp so I dont have to type in "Yes" exactly in order to use growfs interactively.
>How-To-Repeat:
md=$(mdconfig -a -t malloc -s 100m)
newfs -s 50m /dev/$md
sh -c 'newfs -s $(( 50 * 1024 * 1024  / 512 )) /dev/$md'
growfs /dev/$md
>Fix:


Patch attached with submission follows:

From f30baf745ad8704685fd32701c7bd492129c05da Mon Sep 17 00:00:00 2001
From: Garrett Cooper <yanegomi@gmail.com>
Date: Wed, 8 May 2013 08:41:08 -0700
Subject: [PATCH] Don't be picky with case for yes/no prompt

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
---
 sbin/growfs/growfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index fe49efb..e011a1b 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -1544,7 +1544,7 @@ main(int argc, char **argv)
 		printf(" from %s to %s? [Yes/No] ", oldsizebuf, newsizebuf);
 		fflush(stdout);
 		fgets(reply, (int)sizeof(reply), stdin);
-		if (strcmp(reply, "Yes\n")){
+		if (strcasecmp(reply, "yes\n") != 0) {
 			printf("\nNothing done\n");
 			exit (0);
 		}
-- 
1.8.2



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Wed May 8 17:15:03 UTC 2013 
Responsible-Changed-Why:  
I'll take it. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/178422: commit references a PR
Date: Wed,  8 May 2013 18:55:50 +0000 (UTC)

 Author: eadler
 Date: Wed May  8 18:55:38 2013
 New Revision: 250377
 URL: http://svnweb.freebsd.org/changeset/base/250377
 
 Log:
   Allow the use of lowercase 'yes'
   
   PR:		bin/178422
   Submitted by:	Garrett Cooper <yaneurabeya@gmail.com>
 
 Modified:
   head/sbin/growfs/growfs.c
 
 Modified: head/sbin/growfs/growfs.c
 ==============================================================================
 --- head/sbin/growfs/growfs.c	Wed May  8 18:39:12 2013	(r250376)
 +++ head/sbin/growfs/growfs.c	Wed May  8 18:55:38 2013	(r250377)
 @@ -1544,7 +1544,7 @@ main(int argc, char **argv)
  		printf(" from %s to %s? [Yes/No] ", oldsizebuf, newsizebuf);
  		fflush(stdout);
  		fgets(reply, (int)sizeof(reply), stdin);
 -		if (strcmp(reply, "Yes\n")){
 +		if (strcasecmp(reply, "Yes\n")){
  			printf("\nNothing done\n");
  			exit (0);
  		}
 _______________________________________________
 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->patched 
State-Changed-By: eadler 
State-Changed-When: Sat May 11 13:54:21 UTC 2013 
State-Changed-Why:  
committed 


http://www.freebsd.org/cgi/query-pr.cgi?pr=178422 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Jun 25 19:40:52 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/178422: commit references a PR
Date: Tue, 25 Jun 2013 20:03:09 +0000 (UTC)

 Author: eadler
 Date: Tue Jun 25 20:02:57 2013
 New Revision: 252210
 URL: http://svnweb.freebsd.org/changeset/base/252210
 
 Log:
   MFC r250377:
   	Allow the use of lowercase 'yes'
   
   PR:		bin/178422
 
 Modified:
   stable/9/sbin/growfs/growfs.c
 Directory Properties:
   stable/9/sbin/growfs/   (props changed)
 
 Modified: stable/9/sbin/growfs/growfs.c
 ==============================================================================
 --- stable/9/sbin/growfs/growfs.c	Tue Jun 25 18:44:15 2013	(r252209)
 +++ stable/9/sbin/growfs/growfs.c	Tue Jun 25 20:02:57 2013	(r252210)
 @@ -1548,7 +1548,7 @@ main(int argc, char **argv)
  		printf(" from %s to %s? [Yes/No] ", oldsizebuf, newsizebuf);
  		fflush(stdout);
  		fgets(reply, (int)sizeof(reply), stdin);
 -		if (strcmp(reply, "Yes\n")){
 +		if (strcasecmp(reply, "Yes\n")){
  			printf("\nNothing done\n");
  			exit (0);
  		}
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/178422: commit references a PR
Date: Tue, 25 Jun 2013 20:03:19 +0000 (UTC)

 Author: eadler
 Date: Tue Jun 25 20:03:06 2013
 New Revision: 252211
 URL: http://svnweb.freebsd.org/changeset/base/252211
 
 Log:
   MFC r250377:
   	Allow the use of lowercase 'yes'
   
   PR:		bin/178422
 
 Modified:
   stable/8/sbin/growfs/growfs.c
 Directory Properties:
   stable/8/sbin/growfs/   (props changed)
 
 Modified: stable/8/sbin/growfs/growfs.c
 ==============================================================================
 --- stable/8/sbin/growfs/growfs.c	Tue Jun 25 20:02:57 2013	(r252210)
 +++ stable/8/sbin/growfs/growfs.c	Tue Jun 25 20:03:06 2013	(r252211)
 @@ -2162,7 +2162,7 @@ main(int argc, char **argv)
  		    "before growing the Filesystem\n\n"
  		    " Did you backup your data (Yes/No) ? ");
  		fgets(reply, (int)sizeof(reply), stdin);
 -		if (strcmp(reply, "Yes\n")){
 +		if (strcasecmp(reply, "Yes\n")){
  			printf("\n Nothing done \n");
  			exit (0);
  		}
 _______________________________________________
 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:
