summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-03-28 15:24:41 +0000
committerimp <imp@FreeBSD.org>1997-03-28 15:24:41 +0000
commit054f35c2222ef251bc2877814cf7bf5ff6038166 (patch)
treebf569c1217b3803ad2d64ba6083e1610213c7ece
parent3ad19c4ae3d0f156867d86a310e2d6d0f40a7a51 (diff)
downloadFreeBSD-src-054f35c2222ef251bc2877814cf7bf5ff6038166.zip
FreeBSD-src-054f35c2222ef251bc2877814cf7bf5ff6038166.tar.gz
compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
-rw-r--r--bin/cat/cat.c4
-rw-r--r--bin/chmod/chmod.c4
-rw-r--r--bin/cp/cp.c4
-rw-r--r--bin/date/date.c4
-rw-r--r--bin/df/df.c4
-rw-r--r--bin/ed/main.c4
-rw-r--r--bin/hostname/hostname.c4
-rw-r--r--bin/ln/ln.c4
-rw-r--r--bin/ls/ls.c6
-rw-r--r--bin/mkdir/mkdir.c4
-rw-r--r--bin/mv/mv.c4
-rw-r--r--bin/pax/options.c4
-rw-r--r--bin/ps/ps.c4
-rw-r--r--bin/pwd/pwd.c4
-rw-r--r--bin/rcp/rcp.c4
-rw-r--r--bin/rm/rm.c6
-rw-r--r--bin/rmail/rmail.c4
-rw-r--r--bin/rmdir/rmdir.c4
-rw-r--r--bin/sh/histedit.c4
-rw-r--r--bin/sleep/sleep.c4
-rw-r--r--bin/stty/stty.c4
21 files changed, 44 insertions, 44 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 101653d..175f2f8 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: cat.c,v 1.8 1997/02/22 14:01:26 peter Exp $
*/
#ifndef lint
@@ -78,7 +78,7 @@ main(argc, argv)
setlocale(LC_CTYPE, "");
- while ((ch = getopt(argc, argv, "benstuv")) != EOF)
+ while ((ch = getopt(argc, argv, "benstuv")) != -1)
switch (ch) {
case 'b':
bflag = nflag = 1; /* -b implies -n */
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index 2004a51..6d61ca4 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: chmod.c,v 1.8 1997/02/22 14:01:30 peter Exp $
*/
#ifndef lint
@@ -73,7 +73,7 @@ main(argc, argv)
set = NULL;
omode = 0;
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
- while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != EOF)
+ while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index b45582c..6143c10 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: cp.c,v 1.13 1997/02/22 14:01:33 peter Exp $
*/
#ifndef lint
@@ -105,7 +105,7 @@ main(argc, argv)
char *target;
Hflag = Lflag = Pflag = 0;
- while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
+ while ((ch = getopt(argc, argv, "HLPRfipr")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
diff --git a/bin/date/date.c b/bin/date/date.c
index 815a304..4d7e74e 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: date.c,v 1.10 1997/02/22 14:02:33 peter Exp $
*/
#ifndef lint
@@ -84,7 +84,7 @@ main(argc, argv)
tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 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) {
case 'd': /* daylight savings time */
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
diff --git a/bin/df/df.c b/bin/df/df.c
index f32dba3..122906c 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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
@@ -85,7 +85,7 @@ main(argc, argv)
char *mntpt, **vfslist;
vfslist = NULL;
- while ((ch = getopt(argc, argv, "iknt:")) != EOF)
+ while ((ch = getopt(argc, argv, "iknt:")) != -1)
switch (ch) {
case 'i':
iflag = 1;
diff --git a/bin/ed/main.c b/bin/ed/main.c
index 22206ed..d17ab62 100644
--- a/bin/ed/main.c
+++ b/bin/ed/main.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: main.c,v 1.9 1997/02/22 14:03:17 peter Exp $
*/
#ifndef lint
@@ -122,7 +122,7 @@ main(argc, argv)
red = (n = strlen(argv[0])) > 2 && argv[0][n - 3] == 'r';
top:
- while ((c = getopt(argc, argv, "p:sx")) != EOF)
+ while ((c = getopt(argc, argv, "p:sx")) != -1)
switch(c) {
case 'p': /* set prompt */
prompt = optarg;
diff --git a/bin/hostname/hostname.c b/bin/hostname/hostname.c
index a64beef..15aee00 100644
--- a/bin/hostname/hostname.c
+++ b/bin/hostname/hostname.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: hostname.c,v 1.5 1997/02/22 14:03:42 peter Exp $
*/
#ifndef lint
@@ -62,7 +62,7 @@ main(argc,argv)
char *p, hostname[MAXHOSTNAMELEN];
sflag = 0;
- while ((ch = getopt(argc, argv, "s")) != EOF)
+ while ((ch = getopt(argc, argv, "s")) != -1)
switch (ch) {
case 's':
sflag = 1;
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index e6d5f65..8146740 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: ln.c,v 1.9 1997/02/22 14:03:49 peter Exp $
*/
#ifndef lint
@@ -71,7 +71,7 @@ main(argc, argv)
int ch, exitval;
char *sourcedir;
- while ((ch = getopt(argc, argv, "fs")) != EOF)
+ while ((ch = getopt(argc, argv, "fs")) != -1)
switch (ch) {
case 'f':
fflag = 1;
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 60bb051..353914f 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: ls.c,v 1.13 1997/02/22 14:03:59 peter Exp $
*/
#ifndef lint
@@ -135,9 +135,9 @@ main(argc, argv)
fts_options = FTS_PHYSICAL;
#ifdef BSD4_4_LITE
- while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != EOF) {
+ while ((ch = getopt(argc, argv, "1ACFLRTacdfgikloqrstu")) != -1) {
#else
- while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != EOF) {
+ while ((ch = getopt(argc, argv, "1ACFLRTWacdfgikloqrstu")) != -1) {
#endif
switch (ch) {
/*
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index 7857a0d..4b9c0d5 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: mkdir.c,v 1.8 1997/02/22 14:04:08 peter Exp $
*/
#ifndef lint
@@ -67,7 +67,7 @@ main(argc, argv)
omode = pflag = 0;
mode = NULL;
- while ((ch = getopt(argc, argv, "m:p")) != EOF)
+ while ((ch = getopt(argc, argv, "m:p")) != -1)
switch(ch) {
case 'p':
pflag = 1;
diff --git a/bin/mv/mv.c b/bin/mv/mv.c
index aeddd9c..ea6db6d 100644
--- a/bin/mv/mv.c
+++ b/bin/mv/mv.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* 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
@@ -79,7 +79,7 @@ main(argc, argv)
int ch;
char path[MAXPATHLEN + 1];
- while ((ch = getopt(argc, argv, "fi")) != EOF)
+ while ((ch = getopt(argc, argv, "fi")) != -1)
switch (ch) {
case 'i':
iflg = 1;
diff --git a/bin/pax/options.c b/bin/pax/options.c
index 4edd43f..3e0efa4 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: options.c,v 1.7 1997/02/22 14:04:33 peter Exp $
*/
#ifndef lint
@@ -195,7 +195,7 @@ pax_options(argc, argv)
* process option flags
*/
while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:B:DE:G:HLPT:U:XYZ"))
- != EOF) {
+ != -1) {
switch (c) {
case 'a':
/*
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index ee2d407..a26b981 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: ps.c,v 1.17 1997/02/22 14:05:08 peter Exp $
*/
#ifndef lint
@@ -139,7 +139,7 @@ main(argc, argv)
ttydev = NODEV;
memf = nlistf = swapf = NULL;
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) {
case 'a':
all = 1;
diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c
index d80423a..63b6868 100644
--- a/bin/pwd/pwd.c
+++ b/bin/pwd/pwd.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: pwd.c,v 1.5 1997/02/22 14:05:16 peter Exp $
*/
#ifndef lint
@@ -65,7 +65,7 @@ main(argc, argv)
* there's no way to display a logical path after forking. We don't
* 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) {
case 'P':
break;
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index 72baa44..a186f83 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: rcp.c,v 1.11 1997/02/22 14:05:22 peter Exp $
*/
#ifndef lint
@@ -121,7 +121,7 @@ main(argc, argv)
char *targ, *shell;
fflag = tflag = 0;
- while ((ch = getopt(argc, argv, OPTIONS)) != EOF)
+ while ((ch = getopt(argc, argv, OPTIONS)) != -1)
switch(ch) { /* User-visible flags. */
case 'K':
#ifdef KERBEROS
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 80f6012d..40a86dc 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: rm.c,v 1.14 1997/02/22 14:05:27 peter Exp $
*/
#ifndef lint
@@ -93,9 +93,9 @@ main(argc, argv)
Pflag = rflag = 0;
#ifdef BSD4_4_LITE
- while ((ch = getopt(argc, argv, "dfiPRr")) != EOF)
+ while ((ch = getopt(argc, argv, "dfiPRr")) != -1)
#else
- while ((ch = getopt(argc, argv, "dfiPRrW")) != EOF)
+ while ((ch = getopt(argc, argv, "dfiPRrW")) != -1)
#endif
switch(ch) {
case 'd':
diff --git a/bin/rmail/rmail.c b/bin/rmail/rmail.c
index 52b60aa..f80cd3b 100644
--- a/bin/rmail/rmail.c
+++ b/bin/rmail/rmail.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: rmail.c,v 1.9 1997/02/22 14:05:31 peter Exp $
*/
#ifndef lint
@@ -101,7 +101,7 @@ main(argc, argv)
debug = 0;
domain = "UUCP"; /* Default "domain". */
- while ((ch = getopt(argc, argv, "D:T")) != EOF)
+ while ((ch = getopt(argc, argv, "D:T")) != -1)
switch (ch) {
case 'T':
debug = 1;
diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c
index 9830835..8967292 100644
--- a/bin/rmdir/rmdir.c
+++ b/bin/rmdir/rmdir.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: rmdir.c,v 1.5 1997/02/22 14:05:40 peter Exp $
*/
#ifndef lint
@@ -62,7 +62,7 @@ main(argc, argv)
int pflag;
pflag = 0;
- while ((ch = getopt(argc, argv, "p")) != EOF)
+ while ((ch = getopt(argc, argv, "p")) != -1)
switch(ch) {
case 'p':
pflag = 1;
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index c6376ae..5605d13 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: histedit.c,v 1.9 1997/02/22 13:58:27 peter Exp $
*/
#ifndef lint
@@ -206,7 +206,7 @@ histcmd(argc, argv)
optreset = 1; optind = 1; /* initialize getopt */
while (not_fcnumber(argv[optind]) &&
- (ch = getopt(argc, argv, ":e:lnrs")) != EOF)
+ (ch = getopt(argc, argv, ":e:lnrs")) != -1)
switch ((char)ch) {
case 'e':
editor = optarg;
diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c
index 892c520..d11dd07 100644
--- a/bin/sleep/sleep.c
+++ b/bin/sleep/sleep.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: sleep.c,v 1.5 1997/02/22 14:05:45 peter Exp $
*/
#ifndef lint
@@ -56,7 +56,7 @@ main(argc, argv)
{
int ch, secs;
- while ((ch = getopt(argc, argv, "")) != EOF)
+ while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
case '?':
default:
diff --git a/bin/stty/stty.c b/bin/stty/stty.c
index 3bf2fd6..123e8e2 100644
--- a/bin/stty/stty.c
+++ b/bin/stty/stty.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: stty.c,v 1.9 1997/02/22 14:05:54 peter Exp $
*/
#ifndef lint
@@ -72,7 +72,7 @@ main(argc, argv)
opterr = 0;
while (optind < argc &&
strspn(argv[optind], "-aefg") == strlen(argv[optind]) &&
- (ch = getopt(argc, argv, "aef:g")) != EOF)
+ (ch = getopt(argc, argv, "aef:g")) != -1)
switch(ch) {
case 'a': /* undocumented: POSIX compatibility */
fmt = POSIX;
OpenPOWER on IntegriCloud