delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2003/02/02/07:00:38

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Message-Id: <3.0.5.32.20030202070014.007fb4d0@h00207811519c.ne.client2.attbi.com>
X-Sender: pierre AT h00207811519c DOT ne DOT client2 DOT attbi DOT com
Date: Sun, 02 Feb 2003 07:00:14 -0500
To: cygwin-developers AT cygwin DOT com
From: "Pierre A. Humblet" <Pierre DOT Humblet AT ieee DOT org>
Subject: Re: 1.3.20
In-Reply-To: <20030201183003.GB3005@redhat.com>
References: <3 DOT 0 DOT 5 DOT 32 DOT 20030201061709 DOT 0080be50 AT h00207811519c DOT ne DOT client2 DOT attbi DOT com>
<20030201041117 DOT GA20843 AT redhat DOT com>
<3 DOT 0 DOT 5 DOT 32 DOT 20030201061709 DOT 0080be50 AT h00207811519c DOT ne DOT client2 DOT attbi DOT com>
Mime-Version: 1.0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019