Skip to content

Commit 1ef0623

Browse files
mchehabJonathan Corbet
authored and
Jonathan Corbet
committed
kernel-doc: Make it compatible with Perl versions below 5.12 again
Changeset 4d73270('scripts/kernel-doc: Replacing highlights hash by an array') broke compatibility of the kernel-doc script with older versions of perl by using "keys ARRAY" syntax with is available only on Perl 5.12 or newer, according with: http://perldoc.perl.org/functions/keys.html Restore backward compatibility by replacing "foreach my $k (keys ARRAY)" by a C-like variant: "for (my $k = 0; $k < !ARRAY; $k++)" Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]>
1 parent 8005c49 commit 1ef0623

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/kernel-doc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,7 @@ $kernelversion = get_kernel_version();
27112711

27122712
# generate a sequence of code that will splice in highlighting information
27132713
# using the s// operator.
2714-
foreach my $k (keys @highlights) {
2714+
for (my $k = 0; $k < @highlights; $k++) {
27152715
my $pattern = $highlights[$k][0];
27162716
my $result = $highlights[$k][1];
27172717
# print STDERR "scanning pattern:$pattern, highlight:($result)\n";

0 commit comments

Comments
 (0)