From 1afb00a01b7cab3e68f5af3ca6a7d7d86b8f913e Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 6 Oct 2023 13:01:40 +0000 Subject: [PATCH] pluginapi: remove starting newline in demangled func name (#3502) --- src/plugins/PluginAPI.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp index a133de38..f79af312 100644 --- a/src/plugins/PluginAPI.cpp +++ b/src/plugins/PluginAPI.cpp @@ -301,7 +301,11 @@ APICALL std::vector HyprlandAPI::findFunctionsByName(HANDLE hand count++; } - return SYMBOLSDEMANGLED.substr(pos, SYMBOLSDEMANGLED.find('\n', pos + 1) - pos); + // Skip the newline char itself + if (pos != 0) + pos++; + + return SYMBOLSDEMANGLED.substr(pos, SYMBOLSDEMANGLED.find('\n', pos) - pos); }; if (SYMBOLS.empty()) {