getopt_long.c (126189) | getopt_long.c (126438) |
---|---|
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 126189 2004-02-24 08:07:26Z ache $"); | 65__FBSDID("$FreeBSD: head/lib/libc/stdlib/getopt_long.c 126438 2004-03-01 10:03:34Z ache $"); |
66 67#include <err.h> 68#include <errno.h> 69#include <getopt.h> 70#include <stdlib.h> 71#include <string.h> 72 73#ifdef notyet --- 234 unchanged lines hidden (view full) --- 308 /* 309 * Disable GNU extensions if POSIXLY_CORRECT is set or options 310 * string begins with a '+'. 311 */ 312 if (posixly_correct == -1) 313 posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); 314 if (posixly_correct || *options == '+') 315 flags &= ~FLAG_PERMUTE; | 66 67#include <err.h> 68#include <errno.h> 69#include <getopt.h> 70#include <stdlib.h> 71#include <string.h> 72 73#ifdef notyet --- 234 unchanged lines hidden (view full) --- 308 /* 309 * Disable GNU extensions if POSIXLY_CORRECT is set or options 310 * string begins with a '+'. 311 */ 312 if (posixly_correct == -1) 313 posixly_correct = (getenv("POSIXLY_CORRECT") != NULL); 314 if (posixly_correct || *options == '+') 315 flags &= ~FLAG_PERMUTE; |
316 else if (*options == '-') | 316 /* 317 * Code "else if (*options == '-')" was here. 318 * Try to be more GNU compatible, configure's use us! 319 */ 320 if (*options == '-') |
317 flags |= FLAG_ALLARGS; 318 if (*options == '+' || *options == '-') 319 options++; 320 321 /* 322 * XXX Some GNU programs (like cvs) set optind to 0 instead of 323 * XXX using optreset. Work around this braindamage. 324 */ --- 226 unchanged lines hidden --- | 321 flags |= FLAG_ALLARGS; 322 if (*options == '+' || *options == '-') 323 options++; 324 325 /* 326 * XXX Some GNU programs (like cvs) set optind to 0 instead of 327 * XXX using optreset. Work around this braindamage. 328 */ --- 226 unchanged lines hidden --- |