scripts/documentation-file-ref-check: hint: dash or underline
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 14 Jun 2018 13:14:54 +0000 (10:14 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 15 Jun 2018 21:10:01 +0000 (18:10 -0300)
Sometimes, people use dash instead of underline or vice-versa.
Try to autocorrect it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
scripts/documentation-file-ref-check

index c8bc1c1c1d6e26f3d63e49a8dff1cf0de5dea2f2..d132f756d31d450c885e5ce08b130b65669f1145 100755 (executable)
@@ -104,6 +104,12 @@ foreach my $ref (keys %broken_ref) {
                $f=qx(find . -iname $new) if ($new);
        }
 
+       # usual reason for breakage: use dash or underline
+       if (!$f) {
+               $new =~ s/[-_]/[-_]/g;
+               $f=qx(find . -iname $new) if ($new);
+       }
+
        # Wild guess: seek for the same name on another place
        if (!$f) {
                $f = qx(find . -iname $new) if ($new);