New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!perl -C -w #10127
Comments
From @cpansproutparse_unicode_opts expects to end on '\0'. So #!perl -C -w causes an Use of uninitialized value $category in concatenation (.) or string Flags: Site configuration information for perl 5.11.4: Configured by sprout at Wed Jan 20 14:43:21 PST 2010. Summary of my perl5 (revision 5 version 11 subversion 4 patch Locally applied patches: @INC for perl 5.11.4: Environment for perl 5.11.4: |
From @cpansproutAnd here’s the patch. |
From @cpansproutInline Patchdiff -Nurp blead/t/run/switchC.t blead-C-bug2/t/run/switchC.t
--- blead/t/run/switchC.t 2009-11-19 08:51:41.000000000 -0800
+++ blead-C-bug2/t/run/switchC.t 2010-01-30 14:03:19.000000000 -0800
@@ -18,7 +18,7 @@ BEGIN {
BEGIN { require "./test.pl"; }
-plan(tests => 9);
+plan(tests => 11);
my $r;
@@ -69,6 +69,19 @@ $r = runperl( switches => [ '-CS', '-w'
stderr => 1, );
like( $r, qr/^$b(?:\r?\n)?$/s, '#!perl -C' );
+$r = runperl( switches => [ '-CS' ],
+ progs => [ '#!perl -CS -w', 'print chr(256), !!$^W'],
+ stderr => 1, );
+like( $r, qr/^${b}1(?:\r?\n)?$/s, '#!perl -C followed by another switch' );
+
+$r = runperl( switches => [ '-CS' ],
+ progs => [ '#!perl -C7 -w', 'print chr(256), !!$^W'],
+ stderr => 1, );
+like(
+ $r, qr/^${b}1(?:\r?\n)?$/s,
+ '#!perl -C<num> followed by another switch'
+);
+
$r = runperl( switches => [ '-CA', '-w' ],
progs => [ '#!perl -CS', 'print chr(256)' ],
stderr => 1, );
diff -Nurp blead/util.c blead-C-bug2/util.c
--- blead/util.c 2010-01-15 09:09:09.000000000 -0800
+++ blead-C-bug2/util.c 2010-01-30 13:32:29.000000000 -0800
@@ -5384,8 +5384,11 @@ Perl_parse_unicode_opts(pTHX_ const char
opt = (U32) atoi(p);
while (isDIGIT(*p))
p++;
- if (*p && *p != '\n' && *p != '\r')
+ if (*p && *p != '\n' && *p != '\r') {
+ if(isSPACE(*p)) goto the_end_of_the_opts_parser;
+ else
Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
+ }
}
else {
for (; *p; p++) {
@@ -5411,9 +5414,12 @@ Perl_parse_unicode_opts(pTHX_ const char
case PERL_UNICODE_UTF8CACHEASSERT:
opt |= PERL_UNICODE_UTF8CACHEASSERT_FLAG; break;
default:
- if (*p != '\n' && *p != '\r')
+ if (*p != '\n' && *p != '\r') {
+ if(isSPACE(*p)) goto the_end_of_the_opts_parser;
+ else
Perl_croak(aTHX_
"Unknown Unicode option letter '%c'", *p);
+ }
}
}
}
@@ -5421,6 +5427,8 @@ Perl_parse_unicode_opts(pTHX_ const char
else
opt = PERL_UNICODE_DEFAULT_FLAGS;
+ the_end_of_the_opts_parser:
+
if (opt & ~PERL_UNICODE_ALL_FLAGS)
Perl_croak(aTHX_ "Unknown Unicode option value %"UVuf,
(UV) (opt & ~PERL_UNICODE_ALL_FLAGS)); |
From @cpansproutOn Wed Feb 03 07:15:36 2010, sprout wrote:
Applied as d4a59e5. |
From [Unknown Contact. See original ticket]On Wed Feb 03 07:15:36 2010, sprout wrote:
Applied as d4a59e5. |
@cpansprout - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#72434 (status was 'resolved')
Searchable as RT72434$
The text was updated successfully, but these errors were encountered: