[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Speedup creation of configure.lineno
From: |
Paul Eggert |
Subject: |
Re: [PATCH] Speedup creation of configure.lineno |
Date: |
05 Jan 2004 14:18:50 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
"Paolo Bonzini" <address@hidden> writes:
> Could you please review the patch at
> <http://mail.gnu.org/archive/html/autoconf-patches/2003-11/msg00075.html>?
Oh my goodness, that patch ("Be done with AU_DEFUN's third argument")
will take some time for me to think through. Akim, have you had time
to look at it? If not, perhaps we should just install it after 2.60
comes out.
> > For portability the $ needs to be escaped from 'sed' by surrounding it
> > with square brackets, which in turn need to be doubled, thus: [[$]]LINENO.
>
> What hosts have this problem?
Sorry, I don't recall. Quite possibly those hosts are dead and gone,
or perhaps the bug was actually in some other program that behaved
incorrectly with BREs. However, the existing code escaped $ and so I
thought it better to continue the practice.
> > > + s,$LINENO\([[^'$as_cr_alnum'_]]\)\([[^\n]]*\n\)\(.*\),\3\1\2\3,
> >
> > Hmm, "[^\n]" doesn't have the seemingly-expected meaning here, as
> > backslash loses its special meaning within a bracket expression. See
> > <http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap09.html>.
>
> He he, but it is sed that parses \n and not the regex matcher. :-)
No, GNU sed is broken here. POSIX makes it clear that the \n is part
of the regular expression syntax; it is not an escape sequence that
can be used anywhere. The shell command:
echo n | sed 's/[\n]/o/'
must output 'o', for the same reason that
echo '\\' | sed 's/[\*]/o/'
must replace '\' with 'o'. Solaris 9 sed gets it right.
I'll send you a bug report about this separately.