summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-14 13:11:41 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-14 13:11:41 +0000
commitea325fcd6757b5cbd8060d216d7645be72da5e62 (patch)
tree8ce799d03e01fea24ab2ba29bd1752973a620d56 /process.c
parentf927ec15c9f9db9b213af2dad931fb8f386835c2 (diff)
* process.c (proc_exec_sh): don't strip leading spaces of the script.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/process.c b/process.c
index b4e2b7c94c..41206e180a 100644
--- a/process.c
+++ b/process.c
@@ -1205,11 +1205,13 @@ proc_exec_sh(const char *str, VALUE envp_str)
rb_notimplement();
UNREACHABLE;
#else
+ const char *s;
- while (*str == ' ' || *str == '\t' || *str == '\n')
- str++;
+ s = str;
+ while (*s == ' ' || *s == '\t' || *s == '\n')
+ s++;
- if (!*str) {
+ if (!*s) {
errno = ENOENT;
return -1;
}