From: Petr Baudis Date: Mon, 18 Apr 2005 00:23:26 GMT Subject: Re: [patch] fork optional branch point normazilation Message-ID: <20050418002326.GC1461@pasky.ji.cz> In-Reply-To: Dear diary, on Mon, Apr 18, 2005 at 01:39:10AM CEST, I got a letter where Linus Torvalds told me that... > > > On Sun, 17 Apr 2005, Brad Roberts wrote: > > > > braddr:x:1000:1000:Brad Roberts,,,:/home/braddr:/bin/bash > > > > All gecos entries on all my debian boxes are of the form: > > > > fullname, office number, office extension, and home number > > Ahh, ok. > > I'll make the "cleanup" thing just remove strange characters from the end, > that should fix this kind of thing for now. > > I'd just remove everything after the first strange number, but I can also > see people using the "lastname, firstname" format, and I'd hate to just > ignore firstname in that case. > + /* > + * Go back, and remove crud from the end: some people > + * have commas etc in their gecos field > + */ > + dst--; > + while (--dst >= p) { > + unsigned char c = *dst; > + switch (c) { > + case ',': case ';': case '.': > + *dst = 0; > + continue; > + } > + break; > + } Am I just slow or does the first dst-- make it miss the last trailing /[,;.]/? -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor