bug-gnulib
[Top][All Lists]
Advanced

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

Re: gl_ABSOLUTE_HEADER_ONE and older seds


From: Bruno Haible
Subject: Re: gl_ABSOLUTE_HEADER_ONE and older seds
Date: Fri, 14 Oct 2011 01:51:35 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Paul Eggert wrote:
> diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
> index b7276a3..031bc21 100644
> --- a/m4/absolute-header.m4
> +++ b/m4/absolute-header.m4
> @@ -81,12 +81,12 @@ changequote(,)
>        gl_dirsep_regex='/'
>        ;;
>    esac
> -  gl_absolute_header_sed='\|'"${gl_dirsep_regex}"'$1|{
> +  gl_absolute_header_sed='\|'"${gl_dirsep_regex}"'$1|!d
>        s|.*"\(.*'"${gl_dirsep_regex}"'$1\)".*|\1|
>        s|^/[^/]|//&|
>        p
>        q
> -    }'
> +    '

This patch is working like the current code:

$ { echo foobar ; echo '#line 1 "/usr/include/foo/stdio.h"'; echo blabla; echo 
'#line 22 "/usr/include/foo/stdio.h"'; echo '#line 1 
"/usr/include/foo/stdlib.h"'; } > in

$ sed -n -e '\|/stdio.h|{
s|.*"\(.*/stdio.h\)".*|\1|
s|^/[^/]|//&|
p
q
}' < in
///usr/include/foo/stdio.h

$ sed -n -e '\|/stdio.h|!d
s|.*"\(.*/stdio.h\)".*|\1|
s|^/[^/]|//&|
p
q' < in
///usr/include/foo/stdio.h

But it does not help for the NeXTstep case, where sed chokes on any
regex delimiter that is not a slash. So what's the point? Just to avoid
a group of commands? That is not what Daniel's 'sed' is having a problem
with.

Bruno
-- 
In memoriam Bekir Çoban-zade <http://en.wikipedia.org/wiki/Bekir_Çoban-zade>



reply via email to

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