mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Reduce code duplication for nearly identical code-paths
This commit is contained in:
parent
9a78155e17
commit
2824e2989a
10
Process.c
10
Process.c
@ -499,13 +499,9 @@ void Process_makeCommandStr(Process *this) {
|
||||
}
|
||||
}
|
||||
|
||||
if (showProgramPath) {
|
||||
WRITE_HIGHLIGHT(cmdlineBasenameStart, cmdlineBasenameEnd - cmdlineBasenameStart, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME);
|
||||
(void)stpcpyWithNewlineConversion(str, cmdline);
|
||||
} else {
|
||||
WRITE_HIGHLIGHT(0, cmdlineBasenameEnd - cmdlineBasenameStart, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME);
|
||||
(void)stpcpyWithNewlineConversion(str, cmdline + cmdlineBasenameStart);
|
||||
}
|
||||
if (cmdlineBasenameEnd > cmdlineBasenameStart)
|
||||
WRITE_HIGHLIGHT(showProgramPath ? cmdlineBasenameStart : 0, cmdlineBasenameEnd - cmdlineBasenameStart, baseAttr, CMDLINE_HIGHLIGHT_FLAG_BASENAME);
|
||||
(void)stpcpyWithNewlineConversion(str, cmdline + (showProgramPath ? 0 : cmdlineBasenameStart));
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user