autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: status.m4 off-by-one


From: Ralf Wildenhues
Subject: Re: status.m4 off-by-one
Date: Wed, 9 Nov 2005 21:36:38 +0100
User-agent: Mutt/1.5.9i

Hi Paul,

* Paul Eggert wrote on Tue, Nov 08, 2005 at 10:34:56PM CET:
> I don't quite understand the bug or the patch but you might as well
> install it if it fixes your bug.  Thanks.

This snippet:

 m4_if(_AC_SED_CMD_LIMIT,
    m4_if(_AC_Var, address@hidden@], m4_if(_AC_SED_CMD_NUM, 2, 2, 
_AC_SED_CMD_LIMIT), _AC_SED_CMD_NUM),
 [blurb])

is supposed to encode this:
  expand to blurb, iff (
     ( (_AC_Var equals @END@) and (_AC_SED_CMD_NUM is not equal to 2) )
    or
     (_AC_SED_CMD_LIMIT equals _AC_SED_CMD_NUM)
   ) 

which in turn means, more informally:
  if we've filled one sed script, or we're both at the end of the loop
  over all variables and the current sed script doesn't happen to be
  empty (which means non-existant, due to other logic),
  then output blurb which is the trailer for the script plus its pre-
  postprocessing.

The hacky part is the encoding of this logic, with mentioning blurb only
once; my version requires _AC_SED_CMD_LIMIT to be != 2 for this to work;
this however is needed anyway, so it's not a real limitation.

It surely could be done differently, or, FWIW, by defining a macro
containing blurb, so we can use it more than once easily.  However,
blurb is actually pretty complicated stuff itself, so.

I've applied the patch.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]