summaryrefslogtreecommitdiff
path: root/usr.bin/getopt/getopt.1
diff options
context:
space:
mode:
authorIgor Sobrado <sobrado@cvs.openbsd.org>2012-11-14 09:55:29 +0000
committerIgor Sobrado <sobrado@cvs.openbsd.org>2012-11-14 09:55:29 +0000
commit4759006d143b949929faf6e477ba502730351888 (patch)
tree9b70091e543125d9564fe3198b2db82e81796960 /usr.bin/getopt/getopt.1
parent270ce83992bcb23b13f45e16ff670a3e23b907de (diff)
fix a bug, hidden by the break statement in the special option case,
in the example code. millert@ suggested using -ne instead of -gt since $# can't be negative. ok millert@
Diffstat (limited to 'usr.bin/getopt/getopt.1')
-rw-r--r--usr.bin/getopt/getopt.16
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/getopt/getopt.1 b/usr.bin/getopt/getopt.1
index 3dca1e02c5f..8a79c93ef61 100644
--- a/usr.bin/getopt/getopt.1
+++ b/usr.bin/getopt/getopt.1
@@ -1,9 +1,9 @@
-.\" $OpenBSD: getopt.1,v 1.16 2010/10/28 18:33:28 jmc Exp $
+.\" $OpenBSD: getopt.1,v 1.17 2012/11/14 09:55:28 sobrado Exp $
.\"
.\" This material, written by Henry Spencer, was released by him
.\" into the public domain and is thus not subject to any copyright.
.\"
-.Dd $Mdocdate: October 28 2010 $
+.Dd $Mdocdate: November 14 2012 $
.Dt GETOPT 1
.Os
.Sh NAME
@@ -65,7 +65,7 @@ then
exit 2
fi
set -- $args
-while [ $# -ge 0 ]
+while [ $# -ne 0 ]
do
case "$1"
in