checkstyle9.pl: Don't use $root if not defined

$root is only defined when given on the command line. Don't try to use
its value when it's not defined.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2024-01-07 09:50:51 -07:00
parent 1e81724578
commit 4748db6ffd

View File

@ -1410,7 +1410,7 @@ sub process {
checkfilename($realfile, \$acpi_testexpected, \$acpi_nontestexpected); checkfilename($realfile, \$acpi_testexpected, \$acpi_nontestexpected);
$p1_prefix = $1; $p1_prefix = $1;
if (!$file && $tree && $p1_prefix ne '' && if (!$file && $tree && $p1_prefix ne '' && defined $root &&
-e "$root/$p1_prefix") { -e "$root/$p1_prefix") {
WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
} }