]> andersk Git - gssapi-openssh.git/blobdiff - openssh/openbsd-compat/getopt.c
merged OpenSSH 4.6p1, openssh-4.6p1-gsskex-20070312.patch, and openssh-4.6p1-hpn12v16...
[gssapi-openssh.git] / openssh / openbsd-compat / getopt.c
index f4fbc9bac3ec2746bbb37741cece0f4bd7484895..5450e43d957b031095191d9bcd1bb850114ab923 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+/* OPENBSD ORIGINAL: lib/libc/stdlib/getopt.c */
+
+#include "includes.h"
 #if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getopt.c,v 1.2 1996/08/19 08:33:32 tholo Exp $";
+static char *rcsid = "$OpenBSD: getopt.c,v 1.5 2003/06/02 20:18:37 millert Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -66,6 +64,9 @@ BSDgetopt(nargc, nargv, ostr)
        static char *place = EMSG;              /* option letter processing */
        char *oli;                              /* option letter list index */
 
+       if (ostr == NULL)
+               return (-1);
+
        if (BSDoptreset || !*place) {           /* update scanning pointer */
                BSDoptreset = 0;
                if (BSDoptind >= nargc || *(place = nargv[BSDoptind]) != '-') {
This page took 0.036304 seconds and 4 git commands to generate.