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: passwd/group parsing


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


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