processLoad() linux fix * (linux)

This commit is contained in:
Sebastian Hildebrandt 2024-08-21 19:34:23 +02:00
parent 642312e166
commit 55a1fc2a3a

View File

@ -1153,7 +1153,7 @@ function processLoad(proc, callback) {
lines.forEach(function (line) { lines.forEach(function (line) {
let data = line.trim().replace(/ +/g, ' ').split(' '); let data = line.trim().replace(/ +/g, ' ').split(' ');
if (data.length > 4) { if (data.length > 4) {
const linuxName = data[4].indexOf('/') >= 0 ? data[4].substring(0, data[4].indexOf('/') - 1) : data[4]; const linuxName = data[4].indexOf('/') >= 0 ? data[4].substring(0, data[4].indexOf('/')) : data[4];
const name = _linux ? (linuxName) : data[4].substring(data[4].lastIndexOf('/') + 1); const name = _linux ? (linuxName) : data[4].substring(data[4].lastIndexOf('/') + 1);
procStats.push({ procStats.push({
name, name,