Re: 4.5.99a (mc-2002-04-26-03) .netrc patch



On Thu, May 09, 2002 at 02:44:33AM +0200, Thomas Zajic wrote:
> > > +    if (*login != NULL) {
> > > +    	if (!strncmp(*login, "*netrc*", 7))
> > 
> > Sorry, but I don't understand, why do you use strncmp instead of simple
> > strcmp?
> 
> No particular reason, just a personal preference. Whenever one of the
> strings to compare has a fixed known length, I usually use strncmp()
> instead of strcmp(). Feel free to change it back if you like strcmp()
> better. ;-)

 Random, gratitous IMHOs:

 *) You'll have to remember to change the magic constant '7' everytime
    unless you use a macro.

 *) Is anti-idiomatic; strncmp() says 'Are the first XX characters the
    same?' and you leave the reader wondering 'Why should "*netrc*XYZ"
    match?'

> PS: it's okay to reply only to the list - I'm subscribed to mc-devel,
>     so there's no need to cc: me in addition to that, and it would save
>     me a couple of duplicate mails.

 Tell mutt you're subscribed so you don't add this header:

  Mail-Followup-To: Thomas Zajic <zlatko gmx at>, mc-devel gnome org

 which asks everyone replying to mc-devel entries to send you a CC. This
mail should have a

  Mail-Followup-To: Thomas Zajic <zlatko gmx at>, mc-devel gnome org

 header. Note that I'm not included in the list as I've told mutt I'm
subscribed to the list and don't want CCs.


-- 
//Björnen. bjorn bjornen nu | http://bjornen.nu

Attachment: pgplVFH9NmBSc.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]