This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.3.20


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.

Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]