Pierre A. Humblet
Sun Feb 2 12:00:00 GMT 2003
At 01:30 PM 2/1/2003 -0500, Christopher Faylor wrote:
>I think I'll just get rid of the default entirely. Nearly every time I
>use a default arg, I end up regretting it, just like this time.
Yep, I don't like this feature either, it makes the code hard to read.
Perhaps you should have Cygwin coding guidelines that the only allowed
default values are 0/false/NULL.
>Ok. Don't you still have to call pr.refresh in the get??ent case in
>case it isn't initialized? Is it guaranteed to be initialized by the time it
>gets to the get* functions? Otherwise, I agree with your assessment.
Your idea of calling only when the position is 0 is right:
"When first called, getgrent() shall return a pointer to a group
structure containing the first entry in the group database. Thereafter,
it shall return a pointer to a group structure containing the next group
structure in the group database, so successive calls may be used to
search the entire database."
I mistakenly thought that setgrent had to be called initially.
More information about the Cygwin-developers