aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/glob.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-17 01:02:24 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-17 01:02:24 +0000
commit609b4783564008cafdeb947bfd613a1bcb5946f6 (patch)
treeec4d830d2bf9d55decdf5bc941ececfe91e71d7d /sysdeps/generic/glob.c
parent7b7b9e70ea0d820c863c78fbf84fe52626a408d6 (diff)
downloadglibc-609b4783564008cafdeb947bfd613a1bcb5946f6.tar
glibc-609b4783564008cafdeb947bfd613a1bcb5946f6.tar.gz
glibc-609b4783564008cafdeb947bfd613a1bcb5946f6.tar.bz2
glibc-609b4783564008cafdeb947bfd613a1bcb5946f6.zip
Update.
2003-01-16 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/powerpc64/getcontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/setcontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/swapcontext.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.h: New file. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: New file. * sysdeps/unix/sysv/linux/configure.in: Minimum kernel for PPC64 is 2.4.21. 2003-01-16 Ulrich Drepper <drepper@redhat.com> * sysdeps/generic/glob.c (glob): Assume sysconf() always returns values != -1 for _LIBC. Use extend_alloca to reallocate alloca'ed buffers. * sysdeps/generic/sysconf.c: Unconditionally implement _SC_GETPW_R_SIZE_MAX and _SC_GETGR_R_SIZE_MAX. * sysdeps/posix/sysconf.c: Likewise.
Diffstat (limited to 'sysdeps/generic/glob.c')
-rw-r--r--sysdeps/generic/glob.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c
index 5e56629082..fa23f8cac1 100644
--- a/sysdeps/generic/glob.c
+++ b/sysdeps/generic/glob.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2002, 2003 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
@@ -284,6 +284,7 @@ extern char *alloca ();
#endif
#ifdef _LIBC
+# include <alloca.h>
# undef strdup
# define strdup(str) __strdup (str)
# define sysconf(id) __sysconf (id)
@@ -697,10 +698,12 @@ glob (pattern, flags, errfunc, pglob)
struct passwd pwbuf;
int save = errno;
+# ifndef _LIBC
if (pwbuflen == -1)
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
Try a moderate value. */
pwbuflen = 1024;
+# endif
pwtmpbuf = (char *) __alloca (pwbuflen);
while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
@@ -711,8 +714,13 @@ glob (pattern, flags, errfunc, pglob)
p = NULL;
break;
}
+# ifdef _LIBC
+ pwtmpbuf = extend_alloca (pwtmpbuf, pwbuflen,
+ 2 * pwbuflen);
+# else
pwbuflen *= 2;
pwtmpbuf = (char *) __alloca (pwbuflen);
+# endif
__set_errno (save);
}
# else
@@ -781,10 +789,12 @@ glob (pattern, flags, errfunc, pglob)
struct passwd pwbuf;
int save = errno;
+# ifndef _LIBC
if (buflen == -1)
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a
moderate value. */
buflen = 1024;
+# endif
pwtmpbuf = (char *) __alloca (buflen);
while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0)
@@ -794,8 +804,12 @@ glob (pattern, flags, errfunc, pglob)
p = NULL;
break;
}
+# ifdef _LIBC
+ pwtmpbuf = extend_alloca (pwtmpbuf, buflen, 2 * buflen);
+# else
buflen *= 2;
pwtmpbuf = __alloca (buflen);
+# endif
__set_errno (save);
}
# else
@@ -1326,9 +1340,9 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
| ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
#if defined _AMIGA || defined VMS
- | FNM_CASEFOLD
+ | FNM_CASEFOLD
#endif
- );
+ );
nfound = 0;
flags |= GLOB_MAGCHAR;