[syslinux] [PATCH 3/5] COM32: Improve opendir() to deal with no '/' at end of string

Gene Cumm gene.cumm at gmail.com
Fri Mar 6 15:58:47 PST 2009


On Fri, Mar 6, 2009 at 1:11 AM, H. Peter Anvin <hpa at zytor.com> wrote:
> Gene Cumm wrote:
>>
>> Currently, the COMBOOT call required a '/' to recognize that you're
>> searching for a directory.  This checks and automatically appends a
>> '/' to the end of the pathname string (by creating another string
>> temporarily) then making the COMBOOT call.
>>
>
> I'm concerned about doing this if we ever intend to make this work
> properly over TFTP.
>

I'm rethinking how I implemented things.

Define a new function searchdir4dir and then one of two ideas:
1) rename the existing function searchdir to something like
searchdir4file then abstract away for a new function called searchdir
2) create a new function searchdir4all or searchdir4any (or along those lines).

The new function will have a new interface that will either
a) require a type of file when called
b) return what type of file is found for the name and a handle that
the caller can dispose of.

I'd lean towards 2-b as it would preserve existing code and allow a
function that might implement a more complete stat() (eliminating the
need to implement stat() in the functional but very resource intensive
and wasteful way that I did; INT 21 AX=0022h for stat()?).  If I did
this, I could more easily remove the dependency for the trailing '/'
in the name.

Thoughts?

-- 
-Gene




More information about the Syslinux mailing list