]> granicus.if.org Git - procps-ng/commitdiff
top: tweak a couple task_show() macros for consistency
authorJim Warner <james.warner@comcast.net>
Sun, 13 Feb 2022 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@dropbear.xyz>
Thu, 17 Feb 2022 07:23:30 +0000 (18:23 +1100)
There was a potential problem with these macros should
that '#define SCROLLVAR_NO' be active and they were to
appear in an 'if' statement (like is necessary for the
master branch version of top under that EU_CMD label).

[ now they're always usable without requiring an ';' ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 492991f43046509332720e35d18f3cd714675af2..f3b9d13d7aa33224ceca726543a62d4055935b4f 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -6045,8 +6045,8 @@ static const char *task_show (const WIN_t *q, int idx) {
     else cp = make_str_utf8((q->varcolbeg < ((int)strlen(pv) - utf8_delta(pv))) \
     ? pv + utf8_embody(pv, q->varcolbeg) : "", q->varcolsz, Js, AUTOX_NO); }
 #else
- #define makeVAR(S) cp = make_str(S, q->varcolsz, Js, AUTOX_NO)
- #define varUTF8(S) cp = make_str_utf8(S, q->varcolsz, Js, AUTOX_NO)
+ #define makeVAR(S)  { cp = make_str(S, q->varcolsz, Js, AUTOX_NO); }
+ #define varUTF8(S)  { cp = make_str_utf8(S, q->varcolsz, Js, AUTOX_NO); }
 #endif
    struct pids_stack *p = q->ppt[idx];
    static char rbuf[ROWMINSIZ];
@@ -6246,15 +6246,15 @@ static const char *task_show (const WIN_t *q, int idx) {
          case EU_ENV:        // PIDS_ENVIRON
          case EU_EXE:        // PIDS_EXE
          case EU_SGN:        // PIDS_SUPGROUPS
-            varUTF8(rSv(i, str));
+            varUTF8(rSv(i, str))
             break;
    /* str, make_str with varialbe width */
          case EU_SGD:        // PIDS_SUPGIDS
-            makeVAR(rSv(EU_SGD, str));
+            makeVAR(rSv(EU_SGD, str))
             break;
    /* str, make_str with varialbe width + additional decoration */
          case EU_CMD:        // PIDS_CMD or PIDS_CMDLINE
-            varUTF8(forest_display(q, idx));
+            varUTF8(forest_display(q, idx))
             break;
          default:            // keep gcc happy
             continue;