Re: binfmt_script and ^M

Ivo Timmermans
2001-02-27T13:38:49Z

Heusden, Folkert van wrote:
> > When running a script (perl in this case) that has DOS-style newlines
> > (\r\n), Linux 2.4.2 can't find an interpreter because it doesn't
> > recognize the \r. The following patch should fix this (untested).
>
> _should_ it work with the \r in it?

IMHO, yes. This set of files were created on Windows, then zipped and
uploaded to a Linux server, unpacked. This does not change the \r.

> There might be a problem with your patch: at the '*)': if the '\n' is the
> first character on the line, the cp-1 (which should be *(cp-1) I think)

You're right there.

> would point before the buffer which can be un-allocated memory.

No, the first two characters are always `#!'.

> + if (cp - 1 == '\r') <------- *)

--
Ivo Timmermans