Path: utzoo!attcan!uunet!mcsun!unido!ztivax!pwo From: pwo@ztivax.UUCP (Peter W Osel) Newsgroups: comp.mail.elm Subject: Re: Priority etc. Summary: Why not use str[n]casecmp(3)? Message-ID: <3641@ztivax.UUCP> Date: 31 Jan 91 14:57:46 GMT References: <3987@stl.stc.co.uk> Reply-To: pwo%sunrise@ztivax.siemens.com (Peter W Osel) Organization: Siemens AG, Munich, W-Germany Lines: 32 In article <3987@stl.stc.co.uk> "Andrew Macpherson" writes: >The comparisons of various header fields in elm are made with the macro >first_word(a,b) which expands to (strncmp(a,b,strlen(b))==0) > >In various places different common capitalisations are tested to set (e.g.) >the Urgency flag. > >I suggest this definition be changed to strincmp allowing many expressions >to be simplified, and a better chance of Non-Urgent messages being handled >correctly :-). > >A side effect is that istrcmp/strnicmp should be moved to opt_utils.c, >and the second copy of istrcmp deleted from newalias. > >Proposed patch: [... patch deleted ...] Why not use the library functions strcasecmp(3) and strncasecmp(3). As far as I understand, these functions will migrate into the standard C libraries of all machines (at least I got them on my SUN :-). Aren't there public domain implementations too? I think these functions would be faster than istrcmp and strnicmp ... Ping, pwo -- Peter W. Osel UUCP: uunet|mcvax!unido!ztivax!pwo Siemens AG, HL SC 3 pwo@ztivax.UUCP D-8000 Munich 80 Internet: pwo%sunrise@ztivax.siemens.com Balanstrasse 73 DECNET: hippie::pwo || sscvx1::osel Phone: +49 89 4144 3825 Fax: +49 89 4144 4009