From: shs@bmobile.com (Steve Schoettler)
Subject: Make shell function doesn't strip \r
15 Sep 1997 10:42:01 -0700
Message-ID: <3.0.3.32.19970915102008.00a38760.cygnus.gnu-win32@bmobile.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: gnu-win32@cygnus.com
Cc: shs@bmobile.com


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@bmobile.com

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
