delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/05/29/12:57:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Mon, 29 May 2000 12:56:16 -0400
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: sed and configure scripts
Message-ID: <20000529125616.A2657@cygnus.com>
Reply-To: cygwin AT sourceware DOT cygnus DOT com
Mail-Followup-To: cygwin AT sourceware DOT cygnus DOT com
References: <20000529115911 DOT I115623 AT niksula DOT cs DOT hut DOT fi> <20000529194656 DOT J115623 AT niksula DOT cs DOT hut DOT fi>
Mime-Version: 1.0
User-Agent: Mutt/1.2i
In-Reply-To: <20000529194656.J115623@niksula.cs.hut.fi>; from vherva@niksula.hut.fi on Mon, May 29, 2000 at 07:46:57PM +0300

On Mon, May 29, 2000 at 07:46:57PM +0300, Ville Herva wrote:
>On Mon, May 29, 2000 at 11:59:11AM +0300, you [Ville Herva] claimed:
>> I must be doing something wrong here. Basicly, it seems like sed would
>> always intepret its input as binary.
>> 
>> I'm trying to run zsh-3.1.6 configure script. All is fine until configure
>> does something like
>> 
>> cat > c.sed << EOF
>> s/ristiina/parkano/g
>> s/oulu/turku/g
>> EOF
>> sed -n -f c.sed < naantali > hollola
>> 
>> Now, c.sed contains dos newlines (0x0d), and sed barfs:
>> 
>> sed: file conftest.frag line 1: Unknown option to 's'
>> 
>> (option 'g^M'...)
>> 
>> my mounts are textmode, but the situation did not change with binary
>> either. The configure script (the cat > ... and the following lines in
>> particular) has no ^M's. CYGWIN=binmode is _not_ set.
>> 
>> cygwin1.ddl snapshot 15052000, newest sed from net.
>
>This is a problem with sed. I tried to recompile sed but its configure
>script failed the same way! How do you people get configure scripts run? I
>couldn't even figure out any bearable work-around.
>
>Sed uses mmap to read executed file:
>
>sed.c::main():
>        case 'f':
>          the_program = compile_file(the_program, optarg);
>          break;
>
>compile.c:.compile_file():
>  if (cmdfile[0] != '-' || cmdfile[1] != '\0')
>    prog.file = ck_fopen(cmdfile, "r");
>  if (map_file(prog.file, &prog.base, &len))
>  
>  
>util.c::cd_fopen():
>  if ( ! (fp = fopen(name, mode)) )
>  
>  
>sed.c::map_file():
>      nbase = VCAST(VOID *)mmap(NULL, CAST(size_t)s.st_size, PROT_READ,
>                                MAP_PRIVATE, fileno(fp), CAST(off_t)0);
>                                
>
>I assume CR/LF translation is not done for mmap? 
>
>Am I missing something obvious?

Nope.  Patches are gratefully accepted.

Until then, endure the horror of removing \r endings from your sed files.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019