Sender: ml AT delorie DOT com Message-ID: <3413F91D.5B73A3AE@cdata.tvnet.hu> Date: Mon, 08 Sep 1997 15:09:49 +0200 From: Molnar Laszlo MIME-Version: 1.0 To: DJGPP workers Subject: problem with glob() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk 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) {