aboutsummaryrefslogtreecommitdiffstats
path: root/EnvScreen.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-12-07 10:26:01 +0100
committerDaniel Lange <DLange@git.local>2020-12-07 10:26:01 +0100
commit65357c8c46154de4e4eca14075bfe5523bb5fc14 (patch)
tree8f430ee5a0d5de377c4e7c94e47842a27c70d7e8 /EnvScreen.c
parentf80394a20254938142011855f2954b3f63fe5909 (diff)
downloaddebian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.tar.gz
debian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.tar.bz2
debian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.zip
New upstream version 3.0.3upstream/3.0.3
Diffstat (limited to 'EnvScreen.c')
-rw-r--r--EnvScreen.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/EnvScreen.c b/EnvScreen.c
index 479a45d..ae63d3e 100644
--- a/EnvScreen.c
+++ b/EnvScreen.c
@@ -1,18 +1,20 @@
-#include "EnvScreen.h"
+#include "config.h" // IWYU pragma: keep
-#include "config.h"
-#include "CRT.h"
-#include "IncSet.h"
-#include "ListItem.h"
-#include "Platform.h"
-#include "StringUtils.h"
+#include "EnvScreen.h"
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+
+#include "CRT.h"
+#include "Macros.h"
+#include "Panel.h"
+#include "Platform.h"
+#include "ProvideCurses.h"
+#include "Vector.h"
+#include "XUtils.h"
-InfoScreenClass EnvScreen_class = {
+const InfoScreenClass EnvScreen_class = {
.super = {
.extends = Class(Object),
.delete = EnvScreen_delete
@@ -24,7 +26,7 @@ InfoScreenClass EnvScreen_class = {
EnvScreen* EnvScreen_new(Process* process) {
EnvScreen* this = xMalloc(sizeof(EnvScreen));
Object_setClass(this, Class(EnvScreen));
- return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " ");
+ return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 3, " ");
}
void EnvScreen_delete(Object* this) {
@@ -32,7 +34,7 @@ void EnvScreen_delete(Object* this) {
}
void EnvScreen_draw(InfoScreen* this) {
- InfoScreen_drawTitled(this, "Environment of process %d - %s", this->process->pid, this->process->comm);
+ InfoScreen_drawTitled(this, "Environment of process %d - %s", this->process->pid, Process_getCommand(this->process));
}
void EnvScreen_scan(InfoScreen* this) {
@@ -45,7 +47,7 @@ void EnvScreen_scan(InfoScreen* this) {
char* env = Platform_getProcessEnv(this->process->pid);
CRT_restorePrivileges();
if (env) {
- for (char *p = env; *p; p = strrchr(p, 0)+1)
+ for (char* p = env; *p; p = strrchr(p, 0) + 1)
InfoScreen_addLine(this, p);
free(env);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy