[Mono-devel-list] [PATCH] Bug 74586 (and other oddities with the beta)
flashdict at gmail.com
Wed Apr 13 17:57:49 EDT 2005
This patch fixes a gnarly little bug with the new io-layer, and it's
interaction with metadata/file-io.c. The problem is that FindNextFile()
in io-layer/io.c doesn't set the cFileName at all in the WapiFindData struct,
if there aren't any files to look at - either an empty directory, or an
unmatched pattern. (num==0) When this happens, metadata/file-io.c happily
calls FindNextFile again, which then calls the utf16 conversion routine on the
uninitialized gunichar2 string, giving a bizarre result. (???????????????)
This patch fixes the problem. It also fixes bug 74586, at least insofar as
avoiding an eventual crash, and allowing the recursive directory listing code
to go as deep as you please. The warnings from the handle not found will
eventually go away, according to what Dick told me.
- If there aren't any files in a given directory, or for a given pattern,
then nully the first element of the cFileName, so that file-io.c won't send
a null off null string to FindNextFile again.
- Test for null as the first element of cFileName. If not null, then convert
the to string for good measure, and then check for the next file, otherwise,
set r=FALSE, and return.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Mono-devel-list