getopt_long.c (127733) | getopt_long.c (127734) |
---|---|
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 127733 2004-04-01 22:09:07Z ache $"); | 65__FBSDID("$FreeBSD: head/lib/libc/stdlib/getopt_long.c 127734 2004-04-01 22:32:28Z 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! */ --- 173 unchanged lines hidden (view full) --- 247 match = i; 248 exact_match = 1; 249 break; 250 } 251 /* 252 * If this is a known short option, don't allow 253 * a partial match of a single character. 254 */ | 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! */ --- 173 unchanged lines hidden (view full) --- 247 match = i; 248 exact_match = 1; 249 break; 250 } 251 /* 252 * If this is a known short option, don't allow 253 * a partial match of a single character. 254 */ |
255 if (short_too && 256 (!(flags & FLAG_LONGONLY) || current_argv_len == 1)) | 255 if (short_too && current_argv_len == 1) |
257 continue; 258 259 if (match == -1) /* first partial match */ 260 match = i; 261 else if ((flags & FLAG_LONGONLY) || 262 long_options[i].has_arg != 263 long_options[match].has_arg || 264 long_options[i].flag != long_options[match].flag || --- 378 unchanged lines hidden --- | 256 continue; 257 258 if (match == -1) /* first partial match */ 259 match = i; 260 else if ((flags & FLAG_LONGONLY) || 261 long_options[i].has_arg != 262 long_options[match].has_arg || 263 long_options[i].flag != long_options[match].flag || --- 378 unchanged lines hidden --- |