Deleted Added
full compact
getopt_long.c (126535) getopt_long.c (126692)
1/* $OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $ */
2/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
3
4/*
5 * Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above

--- 48 unchanged lines hidden (view full) ---

57 */
58
59#if 0
60#if defined(LIBC_SCCS) && !defined(lint)
61static char *rcsid = "$OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $";
62#endif /* LIBC_SCCS and not lint */
63#endif
64#include <sys/cdefs.h>
1/* $OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $ */
2/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
3
4/*
5 * Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above

--- 48 unchanged lines hidden (view full) ---

57 */
58
59#if 0
60#if defined(LIBC_SCCS) && !defined(lint)
61static char *rcsid = "$OpenBSD: getopt_long.c,v 1.16 2004/02/04 18:17:25 millert Exp $";
62#endif /* LIBC_SCCS and not lint */
63#endif
64#include <sys/cdefs.h>
65__FBSDID("$FreeBSD: head/lib/libc/stdlib/getopt_long.c 126535 2004-03-03 08:29:00Z ache $");
65__FBSDID("$FreeBSD: head/lib/libc/stdlib/getopt_long.c 126692 2004-03-06 14:24:10Z ache $");
66
67#include <err.h>
68#include <errno.h>
69#include <getopt.h>
70#include <stdlib.h>
71#include <string.h>
72
73#define GNU_COMPATIBLE /* Be more compatible, configure's use us! */

--- 334 unchanged lines hidden (view full) ---

408 * to the first of them.
409 */
410 optind = nonopt_start;
411 }
412 nonopt_start = nonopt_end = -1;
413 return (-1);
414 }
415 if (*(place = nargv[optind]) != '-' ||
66
67#include <err.h>
68#include <errno.h>
69#include <getopt.h>
70#include <stdlib.h>
71#include <string.h>
72
73#define GNU_COMPATIBLE /* Be more compatible, configure's use us! */

--- 334 unchanged lines hidden (view full) ---

408 * to the first of them.
409 */
410 optind = nonopt_start;
411 }
412 nonopt_start = nonopt_end = -1;
413 return (-1);
414 }
415 if (*(place = nargv[optind]) != '-' ||
416#ifdef GNU_COMPATIBLE
417 place[1] == '\0') {
418#else
416 (place[1] == '\0' && strchr(options, '-') == NULL)) {
419 (place[1] == '\0' && strchr(options, '-') == NULL)) {
420#endif
417 place = EMSG; /* found non-option */
418 if (flags & FLAG_ALLARGS) {
419 /*
420 * GNU extension:
421 * return non-option as argument to option 1
422 */
423 optarg = nargv[optind++];
424 return (INORDER);

--- 204 unchanged lines hidden ---
421 place = EMSG; /* found non-option */
422 if (flags & FLAG_ALLARGS) {
423 /*
424 * GNU extension:
425 * return non-option as argument to option 1
426 */
427 optarg = nargv[optind++];
428 return (INORDER);

--- 204 unchanged lines hidden ---