add a "+" to the options string rather than setting POSIXLY_CORRECT

This commit is contained in:
mrg 2002-10-13 00:32:09 +00:00
parent 9b3e4b9e61
commit ed83539f6e
2 changed files with 5 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: getoldopt.c,v 1.15 2002/10/12 15:39:29 christos Exp $ */
/* $NetBSD: getoldopt.c,v 1.16 2002/10/13 00:32:09 mrg Exp $ */
/*
* Plug-compatible replacement for getopt() for parsing tar-like
@ -11,7 +11,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: getoldopt.c,v 1.15 2002/10/12 15:39:29 christos Exp $");
__RCSID("$NetBSD: getoldopt.c,v 1.16 2002/10/13 00:32:09 mrg Exp $");
#endif /* not lint */
#include <getopt.h>
@ -45,11 +45,6 @@ getoldopt(int argc, char **argv, const char *optstring,
if (use_getopt) {
if (longopts != NULL) {
/*
* Setting POSIXLY_CORRECT here, makes getopt_long
* stop argument processing at the first non-option.
*/
setenv("POSIXLY_CORRECT", "", 0);
return getopt_long(argc, argv, optstring,
longopts, idx);
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.40 2002/10/12 15:39:29 christos Exp $ */
/* $NetBSD: options.c,v 1.41 2002/10/13 00:32:09 mrg Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: options.c,v 1.40 2002/10/12 15:39:29 christos Exp $");
__RCSID("$NetBSD: options.c,v 1.41 2002/10/13 00:32:09 mrg Exp $");
#endif
#endif /* not lint */
@ -764,7 +764,7 @@ tar_options(int argc, char **argv)
* process option flags
*/
while ((c = getoldopt(argc, argv,
"b:cef:hlmopqrstuvwxzBC:HI:LOPTX:Z014578",
"+b:cef:hlmopqrstuvwxzBC:HI:LOPTX:Z014578",
tar_longopts, NULL))
!= -1) {
switch(c) {