* sysdeps/generic/glob.c (glob): Explicitly set gl_pathc to zero
	after globfree() calls.
This commit is contained in:
Ulrich Drepper 2002-02-10 23:36:05 +00:00
parent 87837aace9
commit 03af57939c
2 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,8 @@
2002-02-10 Ulrich Drepper <drepper@redhat.com> 2002-02-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/glob.c (glob): Explicitly set gl_pathc to zero
after globfree() calls.
* elf/dl-deps.c (struct openaux_args): Add open_mode element. * elf/dl-deps.c (struct openaux_args): Add open_mode element.
(openaux): Pass open_mode as new last argument to _dl_map_object. (openaux): Pass open_mode as new last argument to _dl_map_object.
(_dl_map_object_deps): Add new argument open_mode. Initialize (_dl_map_object_deps): Add new argument open_mode. Initialize

View File

@ -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. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or 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 (onealt == NULL)
{ {
if (!(flags & GLOB_APPEND)) if (!(flags & GLOB_APPEND))
globfree (pglob); {
globfree (pglob);
pglob->gl_pathc = 0;
}
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
#endif #endif
@ -501,7 +504,10 @@ glob (pattern, flags, errfunc, pglob)
free (onealt); free (onealt);
#endif #endif
if (!(flags & GLOB_APPEND)) if (!(flags & GLOB_APPEND))
globfree (pglob); {
globfree (pglob);
pglob->gl_pathc = 0;
}
return result; return result;
} }
@ -933,6 +939,7 @@ glob (pattern, flags, errfunc, pglob)
{ {
globfree (&dirs); globfree (&dirs);
globfree (pglob); globfree (pglob);
pglob->gl_pathc = 0;
return status; return status;
} }
@ -943,6 +950,7 @@ glob (pattern, flags, errfunc, pglob)
{ {
globfree (&dirs); globfree (&dirs);
globfree (pglob); globfree (pglob);
pglob->gl_pathc = 0;
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
} }
@ -975,6 +983,7 @@ glob (pattern, flags, errfunc, pglob)
{ {
globfree (&dirs); globfree (&dirs);
globfree (pglob); globfree (pglob);
pglob->gl_pathc = 0;
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
@ -1009,6 +1018,7 @@ glob (pattern, flags, errfunc, pglob)
pglob->gl_pathc - old_pathc)) pglob->gl_pathc - old_pathc))
{ {
globfree (pglob); globfree (pglob);
pglob->gl_pathc = 0;
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
} }
@ -1035,6 +1045,7 @@ glob (pattern, flags, errfunc, pglob)
if (new == NULL) if (new == NULL)
{ {
globfree (pglob); globfree (pglob);
pglob->gl_pathc = 0;
return GLOB_NOSPACE; return GLOB_NOSPACE;
} }
strcpy (&new[len - 2], "/"); strcpy (&new[len - 2], "/");