diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-04-07 10:58:21 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2010-04-07 10:58:21 +0000 |
commit | 4b25e22b0625884774fd5d09654f526c265baa2d (patch) | |
tree | e81a45708468431a673dc19ee5126462c9c5ee50 /libc/posix | |
parent | 774f6474a25106e72432db818dde72aa1b97f6eb (diff) | |
download | eglibc2-4b25e22b0625884774fd5d09654f526c265baa2d.tar.gz |
Merge changes between r10115 and r10195 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@10196 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/posix')
-rw-r--r-- | libc/posix/gai.conf | 9 | ||||
-rw-r--r-- | libc/posix/getopt.c | 25 | ||||
-rw-r--r-- | libc/posix/glob.c | 8 |
3 files changed, 26 insertions, 16 deletions
diff --git a/libc/posix/gai.conf b/libc/posix/gai.conf index 3dba1a905..195287e1c 100644 --- a/libc/posix/gai.conf +++ b/libc/posix/gai.conf @@ -66,3 +66,12 @@ #scopev4 ::ffff:172.16.0.0/108 5 #scopev4 ::ffff:192.168.0.0/112 5 #scopev4 ::ffff:0.0.0.0/96 14 +# +# For sites which use site-local IPv4 addresses behind NAT there is +# the problem that even if IPv4 addresses are preferred they do not +# have the same scope and are therefore not sorted first. To change +# this use only these rules: +# +#scopev4 ::ffff:169.254.0.0/112 2 +#scopev4 ::ffff:127.0.0.0/104 2 +#scopev4 ::ffff:0.0.0.0/96 14 diff --git a/libc/posix/getopt.c b/libc/posix/getopt.c index a7f0b5485..88acff0e2 100644 --- a/libc/posix/getopt.c +++ b/libc/posix/getopt.c @@ -2,7 +2,8 @@ NOTE: getopt is 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-1996,1998-2004,2008,2009 Free Software Foundation, Inc. + Copyright (C) 1987-1996,1998-2004,2008,2009,2010 + 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 @@ -679,8 +680,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, char *buf; if (__asprintf (&buf, _("\ -%s: option '%s' requires an argument\n"), - argv[0], argv[d->optind - 1]) >= 0) +%s: option '--%s' requires an argument\n"), + argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); @@ -697,8 +698,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, } #else fprintf (stderr, - _("%s: option '%s' requires an argument\n"), - argv[0], argv[d->optind - 1]); + _("%s: option '--%s' requires an argument\n"), + argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); @@ -922,7 +923,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, char *buf; if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"), - argv[0], argv[d->optind]) >= 0) + argv[0], d->optarg) >= 0) { _IO_flockfile (stderr); @@ -938,7 +939,7 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, } #else fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"), - argv[0], argv[d->optind]); + argv[0], d->optarg); #endif } d->__nextchar += strlen (d->__nextchar); @@ -1001,8 +1002,8 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, char *buf; if (__asprintf (&buf, _("\ -%s: option '%s' requires an argument\n"), - argv[0], argv[d->optind - 1]) >= 0) +%s: option '-W %s' requires an argument\n"), + argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); @@ -1018,9 +1019,9 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring, free (buf); } #else - fprintf (stderr, - _("%s: option '%s' requires an argument\n"), - argv[0], argv[d->optind - 1]); + fprintf (stderr, _("\ +%s: option '-W %s' requires an argument\n"), + argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); diff --git a/libc/posix/glob.c b/libc/posix/glob.c index b1bd3e4cc..017180a27 100644 --- a/libc/posix/glob.c +++ b/libc/posix/glob.c @@ -439,6 +439,8 @@ glob (pattern, flags, errfunc, pglob) } } + oldcount = pglob->gl_pathc + pglob->gl_offs; + /* Find the filename. */ filename = strrchr (pattern, '/'); #if defined __MSDOS__ || defined WINDOWS32 @@ -556,8 +558,6 @@ glob (pattern, flags, errfunc, pglob) } } - oldcount = pglob->gl_pathc + pglob->gl_offs; - #ifndef VMS if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~') { @@ -1047,9 +1047,9 @@ glob (pattern, flags, errfunc, pglob) : (__stat64 (pglob->gl_pathv[i], &st64) == 0 && S_ISDIR (st64.st_mode)))) { - size_t len = strlen (pglob->gl_pathv[i]) + 2; + size_t len = strlen (pglob->gl_pathv[i]) + 2; char *new = realloc (pglob->gl_pathv[i], len); - if (new == NULL) + if (new == NULL) { globfree (pglob); pglob->gl_pathc = 0; |