openjdk-21/8335610-DiagnosticFramework-CmdLine-is_executable-co.patch

23 lines
917 B
Diff
Raw Normal View History

2025-02-21 15:44:10 +08:00
Subject: 8335610: DiagnosticFramework: CmdLine::is_executable() correction
---
src/hotspot/share/services/diagnosticFramework.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/services/diagnosticFramework.hpp b/src/hotspot/share/services/diagnosticFramework.hpp
index 8313954aa..3f5087fd1 100644
--- a/src/hotspot/share/services/diagnosticFramework.hpp
+++ b/src/hotspot/share/services/diagnosticFramework.hpp
@@ -67,7 +67,7 @@ public:
const char* cmd_addr() const { return _cmd; }
size_t cmd_len() const { return _cmd_len; }
bool is_empty() const { return _cmd_len == 0; }
- bool is_executable() const { return is_empty() || _cmd[0] != '#'; }
+ bool is_executable() const { return !is_empty() && _cmd[0] != '#'; }
bool is_stop() const { return !is_empty() && strncmp("stop", _cmd, _cmd_len) == 0; }
};
--
2.33.0