+static char __run_str[REAL_MAX_JOBS + 1];
+
+/*
+ * Worst level condensing would be 1:4, so allow enough room for that
+ */
+static char run_str[(4 * REAL_MAX_JOBS) + 1];
+
+static void update_condensed_str(char *run_str, char *run_str_condensed)
+{
+ int i, ci, last, nr;
+ size_t len;
+
+ len = strlen(run_str);
+ if (!len)
+ return;
+
+ last = 0;
+ nr = 0;
+ ci = 0;
+ for (i = 0; i < len; i++) {
+ if (!last) {
+new:
+ run_str_condensed[ci] = run_str[i];
+ last = run_str[i];
+ nr = 1;
+ ci++;
+ } else if (last == run_str[i]) {
+ nr++;
+ } else {
+ int elen;
+
+ elen = sprintf(&run_str_condensed[ci], "(%u),", nr);
+ ci += elen;
+ goto new;
+ }
+ }
+
+ if (nr)
+ sprintf(&run_str_condensed[ci], "(%u)", nr);
+}
+