Subject: Re: trailing commas in GECOS field with chfn
To: Rasputin <rasputin@idoru.mine.nu>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-users
Date: 07/11/2002 09:54:46
On Thu, 11 Jul 2002, Rasputin wrote:

> Are these annoying anyone else :) ?

I didn't notice it.

> rasputin:*:<UID>:<GID>:Rasputin,,,:<HOMEDIR>:<SHELL>
>
> (if you leave your phone nunmber, etc blank)
>
> This 'trailing comma' pattern looks a bit rough in mails, etc.

Strange. What applications? For example, pine doesn't include my ",,," in
my name (even though it is in gecos field.)

But getpwnam(3) (and getpwuid) do return a gecos with commas if it is in
it. So I guess some applications clean up and some don't.

> I've attached a little patch to fix it [1], but wondered if it
> would break anything?

Instead of removing the commas afterwards, just don't add (snprintf) all
that info unless each exists first.

> I'm only halfway through K&R chapter 2.

Have fun.

   Jeremy C. Reed
   http://www.reedmedia.net/