diff options
author | Christopher Faylor <me@cgf.cx> | 2014-05-03 23:58:20 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2014-05-03 23:58:20 +0400 |
commit | d8b41bc3d074f0e84fd4645a88d4335f6a41417f (patch) | |
tree | 442be73f64ff9e2588877e9a04fd370d79ddc974 /winsup/cygwin/spawn.cc | |
parent | b0aa67c40e38a89b7675eeb07c8ce354b811f1e4 (diff) |
* spawn.cc (av::setup): Eat trailing whitespace on #! script.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 6aef64440..0482a68c8 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -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); |