lkml.org 
[lkml]   [2001]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectbinfmt_script and ^M
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).

Please Cc me on replies, I'm not on this list. Thanks.


--- binfmt_script.c~ Mon Feb 26 17:42:09 2001
+++ binfmt_script.c Tue Feb 27 13:39:47 2001
@@ -36,6 +36,8 @@
bprm->buf[BINPRM_BUF_SIZE - 1] = '\0';
if ((cp = strchr(bprm->buf, '\n')) == NULL)
cp = bprm->buf+BINPRM_BUF_SIZE-1;
+ if (cp - 1 == '\r')
+ cp--;
*cp = '\0';
while (cp > bprm->buf) {
cp--;
--
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/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.051 / U:0.056 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site