Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/getopt Fix example; problem report and solution by J...



details:   https://anonhg.NetBSD.org/src/rev/716467efa40b
branches:  trunk
changeset: 498972:716467efa40b
user:      wiz <wiz%NetBSD.org@localhost>
date:      Wed Nov 08 12:53:14 2000 +0000

description:
Fix example; problem report and solution by Jim Bernard in PR 10259.

diffstat:

 usr.bin/getopt/getopt.1 |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (37 lines):

diff -r 1711ada5597a -r 716467efa40b usr.bin/getopt/getopt.1
--- a/usr.bin/getopt/getopt.1   Wed Nov 08 12:05:09 2000 +0000
+++ b/usr.bin/getopt/getopt.1   Wed Nov 08 12:53:14 2000 +0000
@@ -1,5 +1,5 @@
-.\"    $NetBSD: getopt.1,v 1.9 1999/12/01 12:03:16 lukem Exp $
-.Dd June 21, 1993
+.\"    $NetBSD: getopt.1,v 1.10 2000/11/08 12:53:14 wiz Exp $
+.Dd November 9, 2000
 .Dt GETOPT 1
 .Os
 .Sh NAME
@@ -50,19 +50,19 @@
        exit 2
 fi
 set \-\- $args
-for i; do
-       shift
-       case "$i"; in
+while [ $# \-gt 0 ]; do
+       case "$1" in
                \-a|\-b)
-                       flag=$i
+                       flag=$1
                        ;;
                \-c)
-                       carg=$1; shift
+                       carg=$2; shift
                        ;;
                \-\-)
-                       break
+                       shift; break
                        ;;
        esac
+       shift
 done
 .Ed
 .Pp



Home | Main Index | Thread Index | Old Index