summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-08-28 13:11:44 +0000
committerNicholas Clark <nick@ccl4.org>2008-08-28 13:11:44 +0000
commitd3133c8951f1251e8d76e1b8b31b8ec2ee12bc89 (patch)
treea175910cd9ae8a5e9e79cf3fac43d6c96fdeb620 /perl.c
parent6459291e97011e9b9c7ca68a2645055ad8be7c1d (diff)
downloadperl-d3133c8951f1251e8d76e1b8b31b8ec2ee12bc89.tar.gz
Fix #30660: Repeated spaces on shebang line stops option parsing
From a patch and test sent by Renée Bäcker in <48B271A3.80808@smart-websolutions.de> p4raw-id: //depot/perl@34234
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index e41ae96292..98437a3e9d 100644
--- a/perl.c
+++ b/perl.c
@@ -3431,8 +3431,10 @@ Internet, point your browser at http://www.perl.org/, the Perl Home Page.\n\n");
return s;
case '*':
case ' ':
- if (s[1] == '-') /* Additional switches on #! line. */
- return s+2;
+ while( *s == ' ' )
+ ++s;
+ if (s[0] == '-') /* Additional switches on #! line. */
+ return s+1;
break;
case '-':
case 0: