compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
This commit is contained in:
parent
caccaa9b2a
commit
93ef08af3e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24348
@ -33,7 +33,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: cat.c,v 1.8 1997/02/22 14:01:26 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -78,7 +78,7 @@ main(argc, argv)
|
|||||||
|
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "benstuv")) != EOF)
|
while ((ch = getopt(argc, argv, "benstuv")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'b':
|
case 'b':
|
||||||
bflag = nflag = 1; /* -b implies -n */
|
bflag = nflag = 1; /* -b implies -n */
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: chmod.c,v 1.8 1997/02/22 14:01:30 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -73,7 +73,7 @@ main(argc, argv)
|
|||||||
set = NULL;
|
set = NULL;
|
||||||
omode = 0;
|
omode = 0;
|
||||||
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
|
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
|
||||||
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != EOF)
|
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'H':
|
case 'H':
|
||||||
Hflag = 1;
|
Hflag = 1;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: cp.c,v 1.13 1997/02/22 14:01:33 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -105,7 +105,7 @@ main(argc, argv)
|
|||||||
char *target;
|
char *target;
|
||||||
|
|
||||||
Hflag = Lflag = Pflag = 0;
|
Hflag = Lflag = Pflag = 0;
|
||||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
|
while ((ch = getopt(argc, argv, "HLPRfipr")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'H':
|
case 'H':
|
||||||
Hflag = 1;
|
Hflag = 1;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: date.c,v 1.10 1997/02/22 14:02:33 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -84,7 +84,7 @@ main(argc, argv)
|
|||||||
tz.tz_dsttime = tz.tz_minuteswest = 0;
|
tz.tz_dsttime = tz.tz_minuteswest = 0;
|
||||||
rflag = 0;
|
rflag = 0;
|
||||||
set_timezone = 0;
|
set_timezone = 0;
|
||||||
while ((ch = getopt(argc, argv, "d:nr:ut:")) != EOF)
|
while ((ch = getopt(argc, argv, "d:nr:ut:")) != -1)
|
||||||
switch((char)ch) {
|
switch((char)ch) {
|
||||||
case 'd': /* daylight savings time */
|
case 'd': /* daylight savings time */
|
||||||
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
|
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: df.c,v 1.13 1997/02/22 14:02:57 peter Exp $
|
* $Id: df.c,v 1.15 1997/03/13 17:41:37 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -85,7 +85,7 @@ main(argc, argv)
|
|||||||
char *mntpt, **vfslist;
|
char *mntpt, **vfslist;
|
||||||
|
|
||||||
vfslist = NULL;
|
vfslist = NULL;
|
||||||
while ((ch = getopt(argc, argv, "iknt:")) != EOF)
|
while ((ch = getopt(argc, argv, "iknt:")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'i':
|
case 'i':
|
||||||
iflag = 1;
|
iflag = 1;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: main.c,v 1.9 1997/02/22 14:03:17 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -122,7 +122,7 @@ main(argc, argv)
|
|||||||
|
|
||||||
red = (n = strlen(argv[0])) > 2 && argv[0][n - 3] == 'r';
|
red = (n = strlen(argv[0])) > 2 && argv[0][n - 3] == 'r';
|
||||||
top:
|
top:
|
||||||
while ((c = getopt(argc, argv, "p:sx")) != EOF)
|
while ((c = getopt(argc, argv, "p:sx")) != -1)
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'p': /* set prompt */
|
case 'p': /* set prompt */
|
||||||
prompt = optarg;
|
prompt = optarg;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: hostname.c,v 1.5 1997/02/22 14:03:42 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -62,7 +62,7 @@ main(argc,argv)
|
|||||||
char *p, hostname[MAXHOSTNAMELEN];
|
char *p, hostname[MAXHOSTNAMELEN];
|
||||||
|
|
||||||
sflag = 0;
|
sflag = 0;
|
||||||
while ((ch = getopt(argc, argv, "s")) != EOF)
|
while ((ch = getopt(argc, argv, "s")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 's':
|
case 's':
|
||||||
sflag = 1;
|
sflag = 1;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: ln.c,v 1.9 1997/02/22 14:03:49 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -71,7 +71,7 @@ main(argc, argv)
|
|||||||
int ch, exitval;
|
int ch, exitval;
|
||||||
char *sourcedir;
|
char *sourcedir;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "fs")) != EOF)
|
while ((ch = getopt(argc, argv, "fs")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'f':
|
case 'f':
|
||||||
fflag = 1;
|
fflag = 1;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: ls.c,v 1.13 1997/02/22 14:03:59 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -135,9 +135,9 @@ main(argc, argv)
|
|||||||
|
|
||||||
fts_options = FTS_PHYSICAL;
|
fts_options = FTS_PHYSICAL;
|
||||||
#ifdef BSD4_4_LITE
|
#ifdef BSD4_4_LITE
|
||||||
while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != EOF) {
|
while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != -1) {
|
||||||
#else
|
#else
|
||||||
while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != EOF) {
|
while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != -1) {
|
||||||
#endif
|
#endif
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
/*
|
/*
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: mkdir.c,v 1.8 1997/02/22 14:04:08 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -67,7 +67,7 @@ main(argc, argv)
|
|||||||
|
|
||||||
omode = pflag = 0;
|
omode = pflag = 0;
|
||||||
mode = NULL;
|
mode = NULL;
|
||||||
while ((ch = getopt(argc, argv, "m:p")) != EOF)
|
while ((ch = getopt(argc, argv, "m:p")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'p':
|
case 'p':
|
||||||
pflag = 1;
|
pflag = 1;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: mv.c,v 1.11 1997/02/22 14:04:12 peter Exp $
|
* $Id: mv.c,v 1.12 1997/03/08 16:05:44 guido Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -79,7 +79,7 @@ main(argc, argv)
|
|||||||
int ch;
|
int ch;
|
||||||
char path[MAXPATHLEN + 1];
|
char path[MAXPATHLEN + 1];
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "fi")) != EOF)
|
while ((ch = getopt(argc, argv, "fi")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'i':
|
case 'i':
|
||||||
iflg = 1;
|
iflg = 1;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: options.c,v 1.7 1997/02/22 14:04:33 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -195,7 +195,7 @@ pax_options(argc, argv)
|
|||||||
* process option flags
|
* process option flags
|
||||||
*/
|
*/
|
||||||
while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:B:DE:G:HLPT:U:XYZ"))
|
while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:B:DE:G:HLPT:U:XYZ"))
|
||||||
!= EOF) {
|
!= -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'a':
|
case 'a':
|
||||||
/*
|
/*
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: ps.c,v 1.17 1997/02/22 14:05:08 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -139,7 +139,7 @@ main(argc, argv)
|
|||||||
ttydev = NODEV;
|
ttydev = NODEV;
|
||||||
memf = nlistf = swapf = NULL;
|
memf = nlistf = swapf = NULL;
|
||||||
while ((ch = getopt(argc, argv,
|
while ((ch = getopt(argc, argv,
|
||||||
"aCceghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != EOF)
|
"aCceghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != -1)
|
||||||
switch((char)ch) {
|
switch((char)ch) {
|
||||||
case 'a':
|
case 'a':
|
||||||
all = 1;
|
all = 1;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: pwd.c,v 1.5 1997/02/22 14:05:16 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -65,7 +65,7 @@ main(argc, argv)
|
|||||||
* there's no way to display a logical path after forking. We don't
|
* there's no way to display a logical path after forking. We don't
|
||||||
* document either flag, only adding -P for future portability.
|
* document either flag, only adding -P for future portability.
|
||||||
*/
|
*/
|
||||||
while ((ch = getopt(argc, argv, "P")) != EOF)
|
while ((ch = getopt(argc, argv, "P")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'P':
|
case 'P':
|
||||||
break;
|
break;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: rcp.c,v 1.11 1997/02/22 14:05:22 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -121,7 +121,7 @@ main(argc, argv)
|
|||||||
char *targ, *shell;
|
char *targ, *shell;
|
||||||
|
|
||||||
fflag = tflag = 0;
|
fflag = tflag = 0;
|
||||||
while ((ch = getopt(argc, argv, OPTIONS)) != EOF)
|
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
|
||||||
switch(ch) { /* User-visible flags. */
|
switch(ch) { /* User-visible flags. */
|
||||||
case 'K':
|
case 'K':
|
||||||
#ifdef KERBEROS
|
#ifdef KERBEROS
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: rm.c,v 1.14 1997/02/22 14:05:27 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -93,9 +93,9 @@ main(argc, argv)
|
|||||||
|
|
||||||
Pflag = rflag = 0;
|
Pflag = rflag = 0;
|
||||||
#ifdef BSD4_4_LITE
|
#ifdef BSD4_4_LITE
|
||||||
while ((ch = getopt(argc, argv, "dfiPRr")) != EOF)
|
while ((ch = getopt(argc, argv, "dfiPRr")) != -1)
|
||||||
#else
|
#else
|
||||||
while ((ch = getopt(argc, argv, "dfiPRrW")) != EOF)
|
while ((ch = getopt(argc, argv, "dfiPRrW")) != -1)
|
||||||
#endif
|
#endif
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'd':
|
case 'd':
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: rmail.c,v 1.9 1997/02/22 14:05:31 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -101,7 +101,7 @@ main(argc, argv)
|
|||||||
|
|
||||||
debug = 0;
|
debug = 0;
|
||||||
domain = "UUCP"; /* Default "domain". */
|
domain = "UUCP"; /* Default "domain". */
|
||||||
while ((ch = getopt(argc, argv, "D:T")) != EOF)
|
while ((ch = getopt(argc, argv, "D:T")) != -1)
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'T':
|
case 'T':
|
||||||
debug = 1;
|
debug = 1;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: rmdir.c,v 1.5 1997/02/22 14:05:40 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -62,7 +62,7 @@ main(argc, argv)
|
|||||||
int pflag;
|
int pflag;
|
||||||
|
|
||||||
pflag = 0;
|
pflag = 0;
|
||||||
while ((ch = getopt(argc, argv, "p")) != EOF)
|
while ((ch = getopt(argc, argv, "p")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'p':
|
case 'p':
|
||||||
pflag = 1;
|
pflag = 1;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: histedit.c,v 1.9 1997/02/22 13:58:27 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -206,7 +206,7 @@ histcmd(argc, argv)
|
|||||||
|
|
||||||
optreset = 1; optind = 1; /* initialize getopt */
|
optreset = 1; optind = 1; /* initialize getopt */
|
||||||
while (not_fcnumber(argv[optind]) &&
|
while (not_fcnumber(argv[optind]) &&
|
||||||
(ch = getopt(argc, argv, ":e:lnrs")) != EOF)
|
(ch = getopt(argc, argv, ":e:lnrs")) != -1)
|
||||||
switch ((char)ch) {
|
switch ((char)ch) {
|
||||||
case 'e':
|
case 'e':
|
||||||
editor = optarg;
|
editor = optarg;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: sleep.c,v 1.5 1997/02/22 14:05:45 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -56,7 +56,7 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
int ch, secs;
|
int ch, secs;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "")) != EOF)
|
while ((ch = getopt(argc, argv, "")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: stty.c,v 1.9 1997/02/22 14:05:54 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -72,7 +72,7 @@ main(argc, argv)
|
|||||||
opterr = 0;
|
opterr = 0;
|
||||||
while (optind < argc &&
|
while (optind < argc &&
|
||||||
strspn(argv[optind], "-aefg") == strlen(argv[optind]) &&
|
strspn(argv[optind], "-aefg") == strlen(argv[optind]) &&
|
||||||
(ch = getopt(argc, argv, "aef:g")) != EOF)
|
(ch = getopt(argc, argv, "aef:g")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'a': /* undocumented: POSIX compatibility */
|
case 'a': /* undocumented: POSIX compatibility */
|
||||||
fmt = POSIX;
|
fmt = POSIX;
|
||||||
|
Loading…
Reference in New Issue
Block a user