Re: binfmt_script and ^M

From: Ivo Timmermans (irt@cistron.nl)
Date: Tue Feb 27 2001 - 08:38:23 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 28 2001 - 21:00:14 EST