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

Björn Eriksson bjorn at bjornen.nu
Thu May 9 13:26:27 UTC 2002


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 at gmx.at>, mc-devel at 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 at gmx.at>, mc-devel at 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 at bjornen.nu | http://bjornen.nu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20020509/add3b133/attachment.asc>


More information about the mc-devel mailing list