From owner-freebsd-bugs@FreeBSD.ORG Wed May 8 16:00:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.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 CB2C8F71 for ; Wed, 8 May 2013 16:00:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9846BAC6 for ; Wed, 8 May 2013 16:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r48G00jb023632 for ; Wed, 8 May 2013 16:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r48G001n023631; Wed, 8 May 2013 16:00:00 GMT (envelope-from gnats) Resent-Date: Wed, 8 May 2013 16:00:00 GMT Resent-Message-Id: <201305081600.r48G001n023631@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper 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 ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/178422: [PATCH] don't be picky about case with yes/no prompt in growfs(8) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 16:00:00 -0000 >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: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 08 16:00:00 UTC 2013 >Closed-Date: >Last-Modified: >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 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 --- 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: >Unformatted: