summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Small <csmall@dropbear.xyz>2022-12-19 16:50:12 +1100
committerCraig Small <csmall@dropbear.xyz>2022-12-19 16:50:12 +1100
commitdd3cb0892d142e370413e1cba582d390042883e5 (patch)
tree804adaabcd74be6ed55d44a1561c03884b2a11b8 /src
parentab978d62ae4154fa7b6e6904d00160751788c9b6 (diff)
downloadprocps-ng-dd3cb0892d142e370413e1cba582d390042883e5.tar.gz
ps: Correct BSD c option
procps 3.3.17 the c option changed the command/args field to cmd but this got removed as part of newlib Functionality is back in with a test case. References: https://bugs.debian.org/1026326 Signed-off-by: Craig Small <csmall@dropbear.xyz>
Diffstat (limited to 'src')
-rw-r--r--src/ps/output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ps/output.c b/src/ps/output.c
index 5a14f5b..26001a6 100644
--- a/src/ps/output.c
+++ b/src/ps/output.c
@@ -403,13 +403,16 @@ Modifications to the arguments are not shown.
static int pr_args(char *restrict const outbuf, const proc_t *restrict const pp){
char *endp;
int rightward, fh;
-setREL2(CMDLINE,ENVIRON)
+setREL3(CMDLINE,CMD,ENVIRON)
endp = outbuf;
rightward = max_rightward;
fh = forest_helper(outbuf);
endp += fh;
rightward -= fh;
- endp += escape_str(endp, rSv(CMDLINE, str, pp), OUTBUF_SIZE_AT(endp), &rightward);
+ if (!bsd_c_option)
+ endp += escape_str(endp, rSv(CMDLINE, str, pp), OUTBUF_SIZE_AT(endp), &rightward);
+ else
+ endp += escape_str(endp, rSv(CMD, str, pp), OUTBUF_SIZE_AT(endp), &rightward);
if(bsd_e_option && rightward>1) {
char *e = rSv(ENVIRON, str, pp);
if(*e != '-' || *(e+1) != '\0') {