mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Update.
2001-08-11 Ulrich Drepper <drepper@redhat.com> * config.h.in: Add #undef line for USE_NONOPTION_FLAGS. * posix/getopt_init.c: Produce code only if USE_NONOPTION_FLAGS is defined. * posix/getopt.c: Use __getopt_nonoption_flags only if USE_NONOPTION_FLAGS is defined. * sysdeps/mach/hurd/i386/init-first.c: Use __getopt_clean_environment only if USE_NONOPTION_FLAGS is defined. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/unix/sysv/linux/init-first.c: Likewise.
This commit is contained in:
parent
a3151b0240
commit
518a0dd201
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
2001-08-11 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* config.h.in: Add #undef line for USE_NONOPTION_FLAGS.
|
||||
* posix/getopt_init.c: Produce code only if USE_NONOPTION_FLAGS is
|
||||
defined.
|
||||
* posix/getopt.c: Use __getopt_nonoption_flags only if
|
||||
USE_NONOPTION_FLAGS is defined.
|
||||
* sysdeps/mach/hurd/i386/init-first.c: Use __getopt_clean_environment
|
||||
only if USE_NONOPTION_FLAGS is defined.
|
||||
* sysdeps/mach/hurd/mips/init-first.c: Likewise.
|
||||
* sysdeps/unix/sysv/linux/init-first.c: Likewise.
|
||||
|
||||
2001-08-11 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* sysdeps/ieee754/ldbl-128/e_j0l.c: New file.
|
||||
|
@ -2,9 +2,9 @@
|
||||
NOTE: getopt is now part of the C library, so if you don't know what
|
||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||
before changing it!
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -253,8 +253,10 @@ static int last_nonopt;
|
||||
/* Bash 2.0 gives us an environment variable containing flags
|
||||
indicating ARGV elements that should not be considered arguments. */
|
||||
|
||||
#ifdef USE_NONOPTION_FLAGS
|
||||
/* Defined in getopt_init.c */
|
||||
extern char *__getopt_nonoption_flags;
|
||||
#endif
|
||||
|
||||
static int nonoption_flags_max_len;
|
||||
static int nonoption_flags_len;
|
||||
@ -278,13 +280,17 @@ store_args_and_env (int argc, char *const *argv)
|
||||
text_set_element (__libc_subinit, store_args_and_env);
|
||||
# endif /* text_set_element */
|
||||
|
||||
# define SWAP_FLAGS(ch1, ch2) \
|
||||
# ifdef USE_NONOPTION_FLAGS
|
||||
# define SWAP_FLAGS(ch1, ch2) \
|
||||
if (nonoption_flags_len > 0) \
|
||||
{ \
|
||||
char __tmp = __getopt_nonoption_flags[ch1]; \
|
||||
__getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
|
||||
__getopt_nonoption_flags[ch2] = __tmp; \
|
||||
}
|
||||
# else
|
||||
# define SWAP_FLAGS(ch1, ch2)
|
||||
# endif
|
||||
#else /* !_LIBC */
|
||||
# define SWAP_FLAGS(ch1, ch2)
|
||||
#endif /* _LIBC */
|
||||
@ -316,7 +322,7 @@ exchange (argv)
|
||||
It leaves the longer segment in the right place overall,
|
||||
but it consists of two parts that need to be swapped next. */
|
||||
|
||||
#ifdef _LIBC
|
||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
||||
/* First make sure the handling of the `__getopt_nonoption_flags'
|
||||
string can work normally. Our top argument must be in the range
|
||||
of the string. */
|
||||
@ -420,7 +426,7 @@ _getopt_initialize (argc, argv, optstring)
|
||||
else
|
||||
ordering = PERMUTE;
|
||||
|
||||
#ifdef _LIBC
|
||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
||||
if (posixly_correct == NULL
|
||||
&& argc == original_argc && argv == original_argv)
|
||||
{
|
||||
@ -539,7 +545,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
Either it does not have option syntax, or there is an environment flag
|
||||
from the shell indicating it is not an option. The later information
|
||||
is only used when the used in the GNU libc. */
|
||||
#ifdef _LIBC
|
||||
#if defined _LIBC && defined USE_NONOPTION_FLAGS
|
||||
# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|
||||
|| (optind < nonoption_flags_len \
|
||||
&& __getopt_nonoption_flags[optind] == '1'))
|
||||
|
@ -18,6 +18,7 @@
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifdef USE_NONOPTION_FLAGS
|
||||
/* Attention: this file is *not* necessary when the GNU getopt functions
|
||||
are used outside the GNU libc. Some additional functionality of the
|
||||
getopt functions in GNU libc require this additional work. */
|
||||
@ -71,3 +72,4 @@ __getopt_clean_environment (char **env)
|
||||
/* Continue the loop in case the name appears again. */
|
||||
}
|
||||
}
|
||||
#endif /* USE_NONOPTION_FLAGS */
|
||||
|
Loading…
Reference in New Issue
Block a user