Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
MinGW: Scan for \r in addition to \n when reading shbang lines
[gitweb.git]
/
compat
/
mingw.c
diff --git
a/compat/mingw.c
b/compat/mingw.c
index cdeda1d9859fd545950e0c39ee7de3c9dc09bb07..b723c4dfd63ef3021e47419bd2dbe570b8ec7b11 100644
(file)
--- a/
compat/mingw.c
+++ b/
compat/mingw.c
@@
-525,8
+525,8
@@
static const char *parse_interpreter(const char *cmd)
if (buf[0] != '#' || buf[1] != '!')
return NULL;
buf[n] = '\0';
- p =
strchr(buf, '\n'
);
- if (!p)
+ p =
buf + strcspn(buf, "\r\n"
);
+ if (!
*
p)
return NULL;
*p = '\0';