delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/09/15/23:23:20

From: paag AT tid DOT es (Pedro A. Aranda Gutiirrez)
Subject: Re: Make shell function doesn't strip \r
15 Sep 1997 23:23:20 -0700 :
Message-ID: <341E21F3.4143.cygnus.gnu-win32@tid.es>
References: <3 DOT 0 DOT 3 DOT 32 DOT 19970915102008 DOT 00a38760 AT bmobile DOT com>
Mime-Version: 1.0
To: Steve Schoettler <shs AT bmobile DOT com>
Cc: gnu-win32 AT cygnus DOT com

Steve Schoettler wrote:
> 
> When you issue the function $(shell foo), the \n is stripped off the end of
> the command but not the \r that preceeds the \n. I seem to have this
> problem both with the cygnus make b18 and the standard gnu distribution
> 3.75 built for NT. I'm using MKS sh.exe for the SHELL but it appears to
> fail with cygnus bash too.
> 
> This problem can be fixed by changing function.c (from make-3.75 near line
> 547):
> 
> from
> 
>    if (buffer[i - 1] == '\n')
>      buffer[--i] = '\0';
>    else
> 
> to
> 
>    if (buffer[i - 1] == '\n') {
>      buffer[--i] = '\0';
>      if (buffer[i-1]=='\r')
>        buffer[--i] = '\0';
>    } else
> 
> This fixes the problem I'm seeing, but I wonder about all the processing
> inside job.c where there are checks for backslash-escaped newlines but no
> checks for \r.
> 
> Steve Schoettler
> shs AT bmobile DOT com

I'm working on a port of GNU make 3.75 using the Minimalist GNUWIN32
headers **and** compiler and I have no problems what so ever with
CR-LF vs CR only. It seems to be a problem with the way the makefile
is opened. 

It might just be something as simple as including the fopen-... headers
from libiberty to solve this problem. Other files (and headers) would
also be of interest in the special case of make-3.75 (I'm thinking of 
pexecute.[ch] and their associated files).

Who is 'in charge' of GNU make-3.75 ? I'd like to share some thoughts 
with him.

Just some thoughts. 

-- 

     +--------------------------------------------------------+
     |  ####   Pedro Andres Aranda Gutierrez                  |
     |  ####   ATM Networks Division                          |
     |  ####   Telefonica I+D          C./ Emilio Vargas, 6   |
     |  ====                           E-28043 Madrid, Spain  |
     |  ====   mailto:paag AT tid DOT es      Tlf +34-1-337 47 02    |
     |  ====                           FAX +34-1-337 45 02    |
     +--------------------------------------------------------+
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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