Patch attached. doh! --Iain
On 12/12/07, Iain Wade <[EMAIL PROTECTED]> wrote: > I appreciate the feedback Lucian & William, > > I have created an _ex() version against the SVN trunk. > > Also, all the apr_dir_open and apr_os_dir_put functions now call up to > apr_os_dir_put_ex to avoid duplication. > > Would this patch be considered for a 1.3 release? > > Regards, > --Iain > > On 12/12/07, Iain Wade <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I believe the apr_os_dir_put function is a bit flawed as it stands. > > > > It seems to support two behaviours: > > > > a/ If it is passed a NULL pointer for a dir handle, it will allocate a > > new object to use > > b/ If it is passed an existing dir handle it will just replace the > > dirstruct. > > > > In the first case however, it fails to allocate an entry buffer, setup > > the cleanup handler, or register a dirname. > > > > In the second case, you are left with a dirstruct which does not match > > the dirname. > > > > Without a correct dirname, it would seem the apr_stat-fill in > > apr_read_dir will always fail because it would not be able to > > construct the full path to the entry. > > > > The apr_dir_t typedef is opaque, so fiddling the dirname after the > > fact is not possible. > > > > I have attached a patch which I would like you to consider, or I would > > appreciate some alternate suggestions. > > > > It has the drawback of altering the apr_os_dir_put() function to > > accept an extra argument (dirname). I don't know your policy of stable > > interfaces, but I haven't really been able to find any other users of > > this call in my searching. > > > > Regards, > > --Iain > > > > >
apr-trunk-os_dir_put_ex.patch
Description: Binary data
