Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114759
b: refs/heads/master
c: 6ecd967
h: refs/heads/master
i:
  114757: 01c5408
  114755: af71cf8
  114751: 02a2391
v: v3
  • Loading branch information
Andy Whitcroft authored and Linus Torvalds committed Oct 16, 2008
1 parent 5522b42 commit 959402c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e09dec4831bbb319987215ea0a280b2a620021b7
refs/heads/master: 6ecd967444223cea4a02d55fdc0f0510baa69523
41 changes: 41 additions & 0 deletions trunk/scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,33 @@ sub CHK {
}
}

sub check_absolute_file {
my ($absolute, $herecurr) = @_;
my $file = $absolute;

##print "absolute<$absolute>\n";

# See if any suffix of this path is a path within the tree.
while ($file =~ s@^[^/]*/@@) {
if (-f "$root/$file") {
##print "file<$file>\n";
last;
}
}
if (! -f _) {
return 0;
}

# It is, so see if the prefix is acceptable.
my $prefix = $absolute;
substr($prefix, -length($file)) = '';

##print "prefix<$prefix>\n";
if ($prefix ne ".../") {
WARN("use relative pathname instead of absolute in changelog text\n" . $herecurr);
}
}

sub process {
my $filename = shift;

Expand Down Expand Up @@ -1168,6 +1195,20 @@ sub process {
$herecurr) if (!$emitted_corrupt++);
}

# Check for absolute kernel paths.
if ($tree) {
while ($line =~ m{(?:^|\s)(/\S*)}g) {
my $file = $1;

if ($file =~ m{^(.*?)(?::\d+)+:?$} &&
check_absolute_file($1, $herecurr)) {
#
} else {
check_absolute_file($file, $herecurr);
}
}
}

# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php
if (($realfile =~ /^$/ || $line =~ /^\+/) &&
$rawline !~ m/^$UTF8*$/) {
Expand Down

0 comments on commit 959402c

Please sign in to comment.