[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue with AS_TR_CPP, m4_cr_all and EBCDIC codeset
From: |
Steve Goetze |
Subject: |
Re: Issue with AS_TR_CPP, m4_cr_all and EBCDIC codeset |
Date: |
Mon, 5 Apr 2010 09:33:08 -0400 |
I tested this morning on my EBCDIC platform - it works well.
Thanks for your help,
--Steve
On Fri, Apr 2, 2010 at 7:32 PM, Eric Blake <address@hidden> wrote:
> On 03/29/2010 10:21 AM, Steve Goetze wrote:
> > To attempt to workaround the problem, I modified m4_cr_all in my copy of
> > m4sugar.m4 from:
> >
> > m4_translit(m4_dquote(m4_format(m4_dquote(m4_for(
> > ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [-])-)
> >
> > to
> >
> > m4_translit(m4_dquote(m4_translit(m4_dquote(m4_format(m4_dquote(m4_for(
> > ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [-])),[$*],[*$])-)
> >
> > This did fix my reported problem, but not being very m4sugar literate, I
> > doubt the robustness of this approach.
> >
> > I would be happy to test a proper fix.
>
> Actually, your patch was spot-on for the solution. However, I found a
> way to reduce the size of it, so here's what I will be committing, if
> you'd like to test it:
>
> diff --git i/ChangeLog w/ChangeLog
> index 9b8c75c..7c8c323 100644
> --- i/ChangeLog
> +++ w/ChangeLog
> @@ -1,3 +1,10 @@
> +2010-04-02 Eric Blake <address@hidden>
> +
> + Fix m4_cr_all for EBCDIC.
> + * lib/m4sugar/m4sugar.m4 (m4_cr_all): Swap * and $, so that we
> + don't end up with $* in EBCDIC.
> + Reported by Steve Goetze.
> +
> 2010-03-28 Ralf Wildenhues <address@hidden>
>
> Do not use @acronym in the manual.
> diff --git i/lib/m4sugar/m4sugar.m4 w/lib/m4sugar/m4sugar.m4
> index 06ac4c6..15fbd35 100644
> --- i/lib/m4sugar/m4sugar.m4
> +++ w/lib/m4sugar/m4sugar.m4
> @@ -2192,13 +2192,16 @@ m4_defn([m4_cr_digits])dnl
> # characters via m4_translit must deal with the fact that m4_translit does
> # not add quotes to the output.
> #
> +# In EBCDIC, $ is immediately followed by *, which leads to problems
> +# if m4_cr_all is inlined into a macro definition; so swap them.
> +#
> # It is mainly useful in generating inverted character range maps, for use
> # in places where m4_translit is faster than an equivalent m4_bpatsubst;
> # the regex `[^a-z]' is equivalent to:
> # m4_translit(m4_dquote(m4_defn([m4_cr_all])), [a-z])
> m4_define([m4_cr_all],
> m4_translit(m4_dquote(m4_format(m4_dquote(m4_for(
> - ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [-])-)
> + ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [$*-], [*$])-)
>
>
> # _m4_define_cr_not(CATEGORY)
>
>
> --
> Eric Blake address@hidden +1-801-349-2682
> Libvirt virtualization library http://libvirt.org
>
>