From owner-freebsd-bugs Thu Feb 22 4:40:12 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6EA3337B684 for ; Thu, 22 Feb 2001 04:40:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f1MCe2487445; Thu, 22 Feb 2001 04:40:02 -0800 (PST) (envelope-from gnats) Received: from starbug.ugh.net.au (starbug.ugh.net.au [203.31.238.37]) by hub.freebsd.org (Postfix) with ESMTP id 1982A37B65D for ; Thu, 22 Feb 2001 04:34:45 -0800 (PST) (envelope-from andrew@ugh.net.au) Received: by starbug.ugh.net.au (Postfix, from userid 1000) id 91DF5A86C; Thu, 22 Feb 2001 23:34:44 +1100 (EST) Message-Id: <20010222123444.91DF5A86C@starbug.ugh.net.au> Date: Thu, 22 Feb 2001 23:34:44 +1100 (EST) From: andrew@ugh.net.au Reply-To: andrew@ugh.net.au To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/25278: bs accepts -s -c but not -sc Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25278 >Category: bin >Synopsis: bs accepts -s -c but not -sc >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: Thu Feb 22 04:40:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Andrew >Release: FreeBSD 4.2-STABLE i386 >Organization: UgH! >Environment: 4.2-STABLE as of a week ago. >Description: The bs program accepts -s and -c as arguments but not -sc. bs was using its own argument passing routines so I changed it over to getopt. While I was at it I added a usage function, changed the program name in the usage message from battle to bs (as that is what it is installed as nowdays), changed the exit value from 1 to EX_USAGE when exiting because of invalid arguments, sorted the included header files as per style(9) and added -Wall to the makefile. I've tried to keep the same programming style as the existing code. >How-To-Repeat: bs -sc (it runs but the c is ignored) >Fix: --- /usr/src/games/bs/Makefile Sat Aug 28 09:28:57 1999 +++ Makefile Thu Feb 22 22:17:20 2001 @@ -2,6 +2,7 @@ PROG= bs MAN6= bs.6 +CFLAGS+=-Wall DPADD= ${LIBNCURSES} ${LIBMYTINFO} LDADD= -lncurses -lmytinfo HIDEGAME=hidegame --- /usr/src/games/bs/bs.c Mon Feb 21 13:07:31 2000 +++ bs.c Thu Feb 22 22:25:08 2001 @@ -9,14 +9,15 @@ * $FreeBSD: src/games/bs/bs.c,v 1.9 2000/02/21 03:07:31 billf Exp $ */ +#include +#include #include #include -#include -#include #include -#include -#include #include +#include +#include +#include #ifndef A_UNDERLINE /* BSD curses */ #define beep() write(1,"\007",1); @@ -1110,58 +1111,50 @@ return(sgetc("YN") == 'Y'); } -static void do_options(c,op) -int c; -char *op[]; +static void usage() { - int i; - if (c > 1) - { - for (i=1; iRelease-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message