| 5.2.4 |
2020-02-11 |
diff --git a/docs/index.html b/docs/index.html
index e3b52ab..01027be 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -170,7 +170,7 @@
systeminformation
- New Version: 5.2.4
+ New Version: 5.2.5
diff --git a/lib/processes.js b/lib/processes.js
index 126d7d8..8221b47 100644
--- a/lib/processes.js
+++ b/lib/processes.js
@@ -525,38 +525,40 @@ function processes(callback) {
checkColumn(11);
const user = line.substring(parsedhead[11].from + offset, parsedhead[11].to + offset2).trim();
checkColumn(12);
- let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim();
- if (fullcommand.substr(0, 1) === '[') { fullcommand = fullcommand.substring(1); }
- if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }
let cmdPath = '';
let command = '';
let params = '';
- // try to figure out where parameter starts
- let firstParamPos = fullcommand.indexOf(' -');
- let firstParamPathPos = fullcommand.indexOf(' /');
- firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);
- firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);
- const firstPos = Math.min(firstParamPos, firstParamPathPos);
- let tmpCommand = fullcommand.substr(0, firstPos);
- const tmpParams = fullcommand.substr(firstPos);
- const lastSlashPos = tmpCommand.lastIndexOf('/');
- if (lastSlashPos >= 0) {
- cmdPath = tmpCommand.substr(0, lastSlashPos);
- tmpCommand = tmpCommand.substr(lastSlashPos + 1);
- }
+ let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim();
+ if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }
+ if (fullcommand.substr(0, 1) === '[') { command = fullcommand.substring(1); }
+ else {
+ // try to figure out where parameter starts
+ let firstParamPos = fullcommand.indexOf(' -');
+ let firstParamPathPos = fullcommand.indexOf(' /');
+ firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);
+ firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);
+ const firstPos = Math.min(firstParamPos, firstParamPathPos);
+ let tmpCommand = fullcommand.substr(0, firstPos);
+ const tmpParams = fullcommand.substr(firstPos);
+ const lastSlashPos = tmpCommand.lastIndexOf('/');
+ if (lastSlashPos >= 0) {
+ cmdPath = tmpCommand.substr(0, lastSlashPos);
+ tmpCommand = tmpCommand.substr(lastSlashPos + 1);
+ }
- if (firstPos === 10000 && tmpCommand.indexOf(' ') > -1) {
- const parts = tmpCommand.split(' ');
- if (fs.existsSync(path.join(cmdPath, parts[0]))) {
- command = parts.shift();
- params = (parts.join(' ') + ' ' + tmpParams).trim();
+ if (firstPos === 10000 && tmpCommand.indexOf(' ') > -1) {
+ const parts = tmpCommand.split(' ');
+ if (fs.existsSync(path.join(cmdPath, parts[0]))) {
+ command = parts.shift();
+ params = (parts.join(' ') + ' ' + tmpParams).trim();
+ } else {
+ command = tmpCommand.trim();
+ params = tmpParams.trim();
+ }
} else {
command = tmpCommand.trim();
params = tmpParams.trim();
}
- } else {
- command = tmpCommand.trim();
- params = tmpParams.trim();
}
return ({