Date: Thu, 13 Oct 2005 05:53:48 -0700 From: "Michael C. Shultz" <ringworm01@gmail.com> To: Sergey Matveychuk <sem@freebsd.org>, "Mark J. Sommer" <msommer@argotsoft.com>, hackers@freebsd.org Subject: Re: portmanager Message-ID: <200510130553.49557.ringworm01@gmail.com> In-Reply-To: <434E46FB.1090800@FreeBSD.org> References: <200510122033.j9CKX5uo040708@argotsoft.com> <200510121515.14805.ringworm01@gmail.com> <434E46FB.1090800@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 13 October 2005 04:37, you wrote:
> 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.
Thanks for the good advice! I'll clean it up for the next change.
-Mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510130553.49557.ringworm01>
