portmanager

Mark J. Sommer msommer at argotsoft.com
Thu Oct 13 05:25:35 PDT 2005


> -----Original Message-----
> From: Sergey Matveychuk [mailto:sem at FreeBSD.org] 
> Sent: 10/13/2005 5:38 AM
> To: Michael C. Shultz
> Cc: Mark J. Sommer; hackers at FreeBSD.org; RW
> Subject: Re: portmanager
> 
> Michael C. Shultz wrote:
> > 
> > if ( getenv("TERM") )
> > {
> > 	. . .
> > }
> 
> Anyway you should use code like that for the cases:
> char *term;
> term = getenv("TERM");
> 
> And check the variable afterwards. It much better than call getenv()
twice.
> And the first condition would be:
> if( term && !strncmp( term, "xterm", 5 ) && isatty(fileno(stdout)) )
> 
> And some people not recomend use '!' with str[n]cmp(). Using '== 0' is
better.
> 
> It was someting about a code style.
> 
> --
> Sem.
> 
Completely agree!




More information about the freebsd-hackers mailing list