Re: [patch] fixup GECOS handling

2005-04-22 Thread Martin Schlemmer
On Fri, 2005-04-22 at 19:18 +0200, Petr Baudis wrote: > Dear diary, on Fri, Apr 22, 2005 at 06:58:25PM CEST, I got a letter > where Martin Schlemmer <[EMAIL PROTECTED]> told me that... > > Meaning, if they use a ',' in one of the fields (and it is a linux > > system with the chfn most probably from

Re: [patch] fixup GECOS handling

2005-04-22 Thread Andy Isaacson
On Fri, Apr 22, 2005 at 09:16:39AM -0700, Kyle Hayes wrote: > if(comma) > if(semi) > /* lastname, firstname; room #; phone # format */ > *semi = 0; > else > *comma = 0; > else if(semi) > *semi = 0; That's a really complicated way of writ

[patch] fixup GECOS handling

2005-04-22 Thread Martin Schlemmer
Hi, This still applies - any reason for not doing this? Thanks, The GECOS is delimited by ',' or ';', so we should only use whatever is before the first ',' or ';' for the full name, rather than just stripping those. Signed-off-by: Martin Schlemmer <[EMAIL PROTECTED]> commit-tree.c: ec5

Re: [patch] fixup GECOS handling

2005-04-18 Thread Martin Schlemmer
On Mon, 2005-04-18 at 22:35 +1000, David Woodhouse wrote: > On Mon, 2005-04-18 at 12:36 +0200, Martin Schlemmer wrote: > > realgecos[strchr(realgecos, ',') - realgecos] = '\0'; > > Er, *strchr(realgecos, ',') = 0; surely? Even if the compiler is clever > enough to optimise out the gratuitous addit

Re: [patch] fixup GECOS handling

2005-04-18 Thread David Woodhouse
On Mon, 2005-04-18 at 12:36 +0200, Martin Schlemmer wrote: > realgecos[strchr(realgecos, ',') - realgecos] = '\0'; Er, *strchr(realgecos, ',') = 0; surely? Even if the compiler is clever enough to optimise out the gratuitous addition and subtraction, that's no real excuse for it. -- dwmw2 - To

[patch] fixup GECOS handling

2005-04-18 Thread Martin Schlemmer
Hi, The gecos is delimited by ',' or ';', so we should only use whatever before the first ',' or ';' for the full name, and not just strip those. Also, a '.' may be valid in the full name (Foo B. Zooman) or email ([EMAIL PROTECTED]). Signed-off-by: Martin Schlemmer <[EMAIL PROTECTED]> commit-tre