checkpatch: repair faulty executable-bit check.

Existing executable-bit test only works on second and later files
contained in the patch.  Correct this so all patches in the file
are tested.

Change-Id: Ie9363473f0d2fc067f9c593c86495d15e8e5d546
Signed-off-by: Gregory Bean <gbean@codeaurora.org>
This commit is contained in:
Gregory Bean
2011-10-17 12:27:01 -07:00
parent f9f07c34c8
commit 246e1f183d

View File

@@ -1229,7 +1229,6 @@ sub process {
my @setup_docs = (); my @setup_docs = ();
my $setup_docs = 0; my $setup_docs = 0;
my $in_code_block = 0;
my $exec_file = ""; my $exec_file = "";
my $shorttext = BEFORE_SHORTTEXT; my $shorttext = BEFORE_SHORTTEXT;
@@ -1375,6 +1374,7 @@ sub process {
if ($line =~ /^diff --git.*?(\S+)$/) { if ($line =~ /^diff --git.*?(\S+)$/) {
$realfile = $1; $realfile = $1;
$realfile =~ s@^([^/]*)/@@; $realfile =~ s@^([^/]*)/@@;
$exec_file = $realfile;
} elsif ($line =~ /^\+\+\+\s+(\S+)/) { } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
$realfile = $1; $realfile = $1;
@@ -1389,16 +1389,14 @@ sub process {
if ($realfile =~ m@^include/asm/@) { if ($realfile =~ m@^include/asm/@) {
ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n"); ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
} }
$in_code_block = 1; $exec_file = "";
next; next;
} }
elsif ($rawline =~ /^diff.+a\/(.+)\sb\/.+$/) { elsif ($rawline =~ /^diff.+a\/(.+)\sb\/.+$/) {
$exec_file = $1; $exec_file = $1;
$in_code_block = 0;
} }
#Check state to make sure we aren't in code block. #Check state to make sure we aren't in code block.
elsif (!$in_code_block && elsif (($exec_file =~ /^.+\.[chS]$/ or
($exec_file =~ /^.+\.[chS]$/ or
$exec_file =~ /^.+\.txt$/ or $exec_file =~ /^.+\.txt$/ or
$exec_file =~ /^.+\.ihex$/ or $exec_file =~ /^.+\.ihex$/ or
$exec_file =~ /^.+\.hex$/ or $exec_file =~ /^.+\.hex$/ or