Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2014-05-03 23:58:20 +0400
committerChristopher Faylor <me@cgf.cx>2014-05-03 23:58:20 +0400
commitd8b41bc3d074f0e84fd4645a88d4335f6a41417f (patch)
tree442be73f64ff9e2588877e9a04fd370d79ddc974 /winsup
parentb0aa67c40e38a89b7675eeb07c8ce354b811f1e4 (diff)
* spawn.cc (av::setup): Eat trailing whitespace on #! script.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/spawn.cc2
2 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c0ea6b997..c68f7f8f5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
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);