Mail Archives: djgpp-workers/1997/09/08/09:13:00
Hi Workers!
If I try this:
struct glob_t pglob;
glob ("noNeSuch.xx*",0,0,&pglob);
globfree (&pglob);
I will get a SIGSEGV. This is because pglob is not touched in glob() as
the docs says. However I looked at another glob() implementation, and it
cleared the struct like in the patch. I think we should use this too.
Laszlo
*** glob.c~ Sun Aug 31 11:32:32 1997
--- glob.c Sun Sep 7 23:34:44 1997
***************
*** 355,358 ****
--- 355,365 ----
slash = '/';
+ if (!(_flags & GLOB_APPEND))
+ {
+ _pglob->gl_pathc = 0;
+ _pglob->gl_pathv = NULL;
+ if (!(flags & GLOB_DOOFFS))
+ _pglob->gl_offs = 0;
+ }
if (glob2(_pattern, pathbuf, preserve_case ? 0 : 1, preserve_case ?
0 : 1) == GLOB_NOSPACE)
{
- Raw text -