From a0acfeed56cbebf28db08edc20015fe078209837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 11 Jan 2023 15:03:16 +0800 Subject: [PATCH] TermiinalShell: code refactor --- src/detection/terminalshell/terminalshell.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 65b06bc78..2c139b5f2 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -156,15 +156,18 @@ bool fftsGetShellVersion(FFstrbuf* exe, const char* exeName, FFstrbuf* version) return ok; } +FF_MAYBE_UNUSED static bool getTerminalVersionTermux(FFstrbuf* version) +{ + ffStrbufSetS(version, getenv("TERMUX_VERSION")); + return true; +} + bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe, FFstrbuf* version) { #ifdef __ANDROID__ if(ffStrbufEqualS(processName, "Termux")) - { - ffStrbufSetS(version, getenv("TERMUX_VERSION")); - return true; - } + return getTerminalVersionTermux(version); #endif