From 9029cc83ad2f12cb447ed80d816684e856733a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 2 Dec 2020 16:06:19 +0100 Subject: [PATCH] Merge identical conditional branches --- linux/LinuxProcess.c | 4 +--- linux/LinuxProcessList.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 388130f7..23b08be2 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -536,9 +536,7 @@ static void LinuxProcess_writeCommand(const Process* this, int attr, int baseAtt RichString_append(str, attr, lp->mergedCommand.str); if (lp->mergedCommand.commEnd) { - if (lp->mergedCommand.separateComm) { - RichString_setAttrn(str, commAttr, commStart, commEnd - 1); - } else if (commStart == baseStart && highlightBaseName) { + if (!lp->mergedCommand.separateComm && commStart == baseStart && highlightBaseName) { /* If it was matched with procExe's basename, make it bold if needed */ if (commEnd > baseEnd) { RichString_setAttrn(str, A_BOLD | baseAttr, baseStart, baseEnd - 1); diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index b8d794a5..6e6b4d8d 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -1117,9 +1117,7 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, openat_arg_t proc command[i] = '\n'; } } else if (!tokenEnd) { - if (command[i] == '/') { - tokenStart = i + 1; - } else if (command[i] == '\\' && (!tokenStart || command[tokenStart - 1] == '\\')) { + if (command[i] == '/' || (command[i] == '\\' && (!tokenStart || command[tokenStart - 1] == '\\'))) { tokenStart = i + 1; } else if (command[i] == ':' && (command[i + 1] != '/' && command[i + 1] != '\\')) { tokenEnd = i;