Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2005 06:24:56 -0600
From:      "Mark J. Sommer" <msommer@argotsoft.com>
To:        "'Sergey Matveychuk'" <sem@FreeBSD.org>, "'Michael C. Shultz'" <ringworm01@gmail.com>
Cc:        hackers@FreeBSD.org, 'RW' <list-freebsd-2004@morbius.sent.com>
Subject:   RE: portmanager
Message-ID:  <200510131225.j9DCOvuo004348@argotsoft.com>
In-Reply-To: <434E46FB.1090800@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message-----
> From: Sergey Matveychuk [mailto:sem@FreeBSD.org] 
> Sent: 10/13/2005 5:38 AM
> To: Michael C. Shultz
> Cc: Mark J. Sommer; hackers@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!





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510131225.j9DCOvuo004348>