Description: ps correct BSD c option
 BSD c option should print command name, not command line like it used to
Author: Craig Small <csmall@dropbear.xyz>
Origin: upstream, https://gitlab.com/procps-ng/procps/-/commit/dd3cb0892d142e370413e1cba582d390042883e5
Bug-Debian: https://bugs.debian.org/1026326
Applied-Upstream: 4.0.3
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2022-12-19
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/ps/output.c
+++ b/src/ps/output.c
@@ -403,13 +403,17 @@
 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') {
