Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ames!husc6!rutgers!att!jhc From: jhc@att.ATT.COM (Jonathan Hawbrook-Clark) Newsgroups: news.software.b Subject: Re: Why does buildfname skip past hyphens? Message-ID: <2510@att.ATT.COM> Date: 5 Jan 89 20:44:16 GMT References: <111@indri.primate.wisc.edu> Reply-To: jhc@att.ATT.COM (Jonathan Hawbrook-Clark) Organization: AT&T Bell Laboratories, Middletown, NJ, USA Lines: 31 In article karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) writes: > >It might be possible for a better heuristic to determine if it's >really SysVish as opposed to a true hyphenated name (looking for >digits would be a good start), but the generalization as it currently >stands is fairly appropriate. I modified the appropriate bit of my smail to read as attached, this handles the System V habit of making the GCOS field look like "12345-A. N. Other(foo)bar", and also handles this case: "12345-Jonathan Hawbrook-Clark". The test sees whether the character before the hyphen is alphabetic - if it is then it assumes that the hyphen is part of a name, otherwise not. Anyone got a better test? Jonathan Clark jonathan@mtune.att.com, attmail!jonathan Any affiliation is given for identification purposes only. The Englishman never enjoys himself except for some noble purpose. -- if ((cend = index(fname, '-')) && !isalpha(cend[-1])) /* * USG name format: name between between '-' and '(' * Note that this now does hyphenated names properly. */ return (++cend); else /* * v7/BSD format: name first thing in field */ return (fname); }