* spawn.cc (av::setup): Eat trailing whitespace on #! script.

This commit is contained in:
Christopher Faylor 2014-05-03 19:58:20 +00:00
parent b0aa67c40e
commit d8b41bc3d0
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2014-05-03 Christopher Faylor <me.cygwin2014@cgf.cx>
* spawn.cc (av::setup): Eat trailing whitespace on #! script.
2014-05-02 Christopher Faylor <me.cygwin2014@cgf.cx>
* fhandler_dsp.cc (ioctl): Use _ioctl for recursive call.

View File

@ -1169,6 +1169,8 @@ av::setup (const char *prog_arg, path_conv& real_path, const char *ext,
{
ptr += strspn (ptr, " \t");
size_t len = strcspn (ptr, "\r\n");
while (ptr[len - 1] == ' ' || ptr[len - 1] == '\t')
len--;
if (len)
{
char *namebuf = (char *) alloca (len + 1);