From 7432fc7a19363c911cd0035ea992aac86c32dfda Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sun, 9 May 2021 12:56:07 +0200 Subject: [PATCH] fixed WM::getFromProcDir --- src/common/detectWMDE.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/detectWMDE.c b/src/common/detectWMDE.c index 8e9d9149a..a6d0a2900 100644 --- a/src/common/detectWMDE.c +++ b/src/common/detectWMDE.c @@ -165,6 +165,7 @@ static void getFromProcDir(FFWMDEResult* result, ProcData* procData, bool search ffStrbufAppendS(&procPath, procData->dirent->d_name); ffStrbufAppendS(&procPath, "/cmdline"); ffGetFileContent(procPath.chars, &processName); + ffStrbufRecalculateLength(&processName); //Arguments are seperated by a \0 char. We make use of this to extract only the executable path. This is needed if arguments contain the / char ffStrbufSubstrAfterLastC(&processName, '/'); ffStrbufSubstrBefore(&procPath, procPathLength); @@ -172,7 +173,7 @@ static void getFromProcDir(FFWMDEResult* result, ProcData* procData, bool search if(applyDEHintIfDE(&processName, &procData->deHint) && !searchWM) break; - //If we have a WM, dont overwrite it. Therefoore searchWM must be first in the condition + //If we have a WM, dont overwrite it. Therefore searchWM must be first in the condition if(searchWM && applyPrettyNameIfWM(result, &processName, &procData->protocolHint)) break; }