Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jan 2024 16:51:55 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4748db6ffd42 - main - checkstyle9.pl: Don't use $root if not defined
Message-ID:  <202401071651.407Gpt0T023594@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=4748db6ffd422f8b52d49f5e2982628ac52afb8c

commit 4748db6ffd422f8b52d49f5e2982628ac52afb8c
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-01-07 16:50:51 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-01-07 16:51:49 +0000

    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
---
 tools/build/checkstyle9.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl
index d2c6ea77868d..3b28fef93669 100755
--- a/tools/build/checkstyle9.pl
+++ b/tools/build/checkstyle9.pl
@@ -1410,7 +1410,7 @@ sub process {
 	                checkfilename($realfile, \$acpi_testexpected, \$acpi_nontestexpected);
 
 			$p1_prefix = $1;
-			if (!$file && $tree && $p1_prefix ne '' &&
+			if (!$file && $tree && $p1_prefix ne '' && defined $root &&
 			    -e "$root/$p1_prefix") {
 				WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401071651.407Gpt0T023594>