delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2003/01/26/19:19:43

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
Date: Sun, 26 Jan 2003 19:19:52 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: passwd/group parsing
Message-ID: <20030127001952.GA1908@redhat.com>
Reply-To: cygwin-developers AT cygwin DOT com
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <3 DOT 0 DOT 5 DOT 32 DOT 20030125204634 DOT 00802ad0 AT mail DOT attbi DOT com> <3 DOT 0 DOT 5 DOT 32 DOT 20030125204634 DOT 00802ad0 AT mail DOT attbi DOT com> <3 DOT 0 DOT 5 DOT 32 DOT 20030126182438 DOT 00805230 AT h00207811519c DOT ne DOT client2 DOT attbi DOT com>
Mime-Version: 1.0
In-Reply-To: <3.0.5.32.20030126182438.00805230@h00207811519c.ne.client2.attbi.com>
User-Agent: Mutt/1.5.1i

On Sun, Jan 26, 2003 at 06:24:38PM -0500, Pierre A. Humblet wrote:
>At 11:55 PM 1/25/2003 -0500, Christopher Faylor wrote:
>>>  It comes from the code in next_str. By the way, why do you add 
>>>  two \0 in "search" used by strpbrk? The second never has any effect.
>>
>>pwdgrp::next_str (char c)
>>{ 
>>  char search[] = ":\n\0\0";
>>  search[2] = c;
>>              ^
>>          an additional character to parse for
>Yep, but that's the first. 

Oh.  *That* second '\0'.  Duh.

>By the way, we never search for both ":" and ",", so search could be
>"\n\0" and the default value of c could be ":".

I was under the impression that it was legal to terminate the final
entry in /etc/group with a colon but testing on linux shows that it
isn't.

I'll change this to strchr.  Actually, I'll change it to 'strechr' since
implementing strechr is another thing I've been meaning to do for a
while.  strechr is a variation of strchr which returns EOS on failure.
It could simplify code throughout cygwin.

cgf

- Raw text -


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