[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [PATCH] if ! is not portable

From: Sander Striker <striker_at_apache.org>
Date: 2002-02-09 19:37:14 CET

> From: Zack Weinberg [mailto:zack@codesourcery.com]
> Sent: 09 February 2002 19:29
> On Sat, Feb 09, 2002 at 07:21:10PM +0100, Sander Striker wrote:

> > /me asking stupid questions...
> >
> > What about:
> >
> > if [ ! `cmp -s ./ac-helpers/find_apr.m4 ./apr/build/find_apr.m4` ]; then
>
> cmp -s produces no output, so this reduces to
>
> if [ ! ]
>
> which is a run-time syntax error.

*grin* Don't let me near arch ;)
 
> The only other portable way to do this is
>
> cmp -s ./ac-helpers/find_apr.m4 ./apr/build/find_apr.m4
> if [ $? -ne 0 ]; then

Ah. Right.

> I don't see what was wrong with
>
> if cmp -s ./ac-helpers/find_apr.m4 ./apr/build/find_apr.m4
> then :
> else
>
> it's a common idiom.

Nothing wrong with it. Just me not liking empty if branches.
But, given that it is common, so be it.

> zw

Thanks for the heads up,

Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:06 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.