Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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