diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-02-10 23:36:05 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-02-10 23:36:05 +0000 |
commit | 03af57939c7216333e000f5e45eae99a99cc5444 (patch) | |
tree | 77571c487a1140afcbbdffe4b3e3b678f81d4a22 /sysdeps | |
parent | 87837aace92ced7be739fb7f3c764bb405fb5b2e (diff) | |
download | glibc-03af57939c7216333e000f5e45eae99a99cc5444.tar glibc-03af57939c7216333e000f5e45eae99a99cc5444.tar.gz glibc-03af57939c7216333e000f5e45eae99a99cc5444.tar.bz2 glibc-03af57939c7216333e000f5e45eae99a99cc5444.zip |
Update.
* sysdeps/generic/glob.c (glob): Explicitly set gl_pathc to zero
after globfree() calls.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/glob.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c index 20cf0a2f5b..af409c54b2 100644 --- a/sysdeps/generic/glob.c +++ b/sysdeps/generic/glob.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999, 2000, 2001, 2002 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 @@ -419,7 +419,10 @@ glob (pattern, flags, errfunc, pglob) if (onealt == NULL) { if (!(flags & GLOB_APPEND)) - globfree (pglob); + { + globfree (pglob); + pglob->gl_pathc = 0; + } return GLOB_NOSPACE; } #endif @@ -501,7 +504,10 @@ glob (pattern, flags, errfunc, pglob) free (onealt); #endif if (!(flags & GLOB_APPEND)) - globfree (pglob); + { + globfree (pglob); + pglob->gl_pathc = 0; + } return result; } @@ -933,6 +939,7 @@ glob (pattern, flags, errfunc, pglob) { globfree (&dirs); globfree (pglob); + pglob->gl_pathc = 0; return status; } @@ -943,6 +950,7 @@ glob (pattern, flags, errfunc, pglob) { globfree (&dirs); globfree (pglob); + pglob->gl_pathc = 0; return GLOB_NOSPACE; } } @@ -975,6 +983,7 @@ glob (pattern, flags, errfunc, pglob) { globfree (&dirs); globfree (pglob); + pglob->gl_pathc = 0; return GLOB_NOSPACE; } @@ -1009,6 +1018,7 @@ glob (pattern, flags, errfunc, pglob) pglob->gl_pathc - old_pathc)) { globfree (pglob); + pglob->gl_pathc = 0; return GLOB_NOSPACE; } } @@ -1035,6 +1045,7 @@ glob (pattern, flags, errfunc, pglob) if (new == NULL) { globfree (pglob); + pglob->gl_pathc = 0; return GLOB_NOSPACE; } strcpy (&new[len - 2], "/"); |