|
From: Earnie B. <ear...@ya...> - 2002-04-15 10:56:01
|
Thanks, this wasn't a known bug. I'll test your patch as you can't yet
build msys dependent binaries.
Earnie.
Infidel wrote:
>
> Hi,
>
> Thanks for your reply. Are you an MSYS developer? If not, how did you know
> that this bug was already reported? If you are referring to the problems
> with Winzip converting tar files to CRLF, I think that it is a separate
> problem, because now most shell scripts (including /etc/profile) work fine
> with CRLF line endings in the current version of MSYS.
>
> The fix that was made to bash just missed the special case of "here
> documents" (see read_a_line()). A possible (untested!) patch to bash/parse.y
> might be:
>
> --- parse.y Mon Apr 15 16:26:27 2002
> +++ parse.y.new Mon Apr 15 16:29:07 2002
> @@ -913,7 +913,15 @@
> int
> yy_getc ()
> {
> +#if __MSYS__ // most definitely needed.
> + int c;
> +
> + while ((c = (*(bash_input.getter)) ()) == '\r')
> + ;
> + return c;
> +#else
> return (*(bash_input.getter)) ();
> +#endif
> }
>
> /* Call this to unget C. That is, to make C the next character
> @@ -1610,11 +1618,6 @@
> QUIT;
>
> RESIZE_MALLOCED_BUFFER (shell_input_line, i, 2,
> shell_input_line_size, 256);
> -
> -#if __MSYS__ // most definitely needed.
> - if (c == '\r')
> - continue;
> -#endif
>
> if (c == EOF)
> {
>
> I know that SourceForge has patch managers for this but I am not in a
> position to test this fix easily (and I didn't see the bash source in CVS)
> so instead I am offering it as a "suggestion" :)
>
> Infidel
>
> ----- Original Message -----
> From: "Paul G." <pga...@at...>
> To: <min...@li...>
> Sent: Sunday, April 14, 2002 6:30 AM
> Subject: Re: [Mingw-msys] Problem with CRLF line endings in shell scripts
>
> >
> >
> > On 13 Apr 2002 at 18:08, Infidel - wrote:
> >
> > >
> > > Hi,
> > >
> > > Given the following shell script:
> > >
> > > #!/bin/sh
> > >
> > > if true ; then
> > > cat > foo <<EOF
> > > bar
> > > EOF
> > > fi
> > >
> > > The MSYS shell runs this properly if the file is saved with Unix LF
> > > line endings, but reports the error "./shtest: line 9: syntax error:
> > > unexpected end of file" if the file is saved in DOS CR/LF format.
> >
> > This one is known. Thanks for the report.
> >
> > You can use tr.exe to replace the DOS '\r\n' if you feel like you want to.
> >
> > Paul G.
> >
> >
>
> _______________________________________________
> Mingw-msys mailing list
> Min...@li...
> https://lists.sourceforge.net/lists/listinfo/mingw-msys
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|