{ 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID },
{ 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID },
{ 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM },
- { 256 , "args" ,"COMMAND",func_args ,PSSCAN_COMM },
+ { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM },
{ 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID },
{ 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID },
{ 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID },
print_header = 1;
}
-static void post_process(void)
+static void alloc_line_buffer(void)
{
int i;
int width = 0;
print_header = 1;
}
width += out[i].width + 1; /* "FIELD " */
+ if ((int)(width - terminal_width) > 0) {
+ /* The rest does not fit on the screen */
+ //out[i].width -= (width - terminal_width - 1);
+ out_cnt = i + 1;
+ break;
+ }
}
#if ENABLE_SELINUX
if (!is_selinux_enabled())
}
parse_o(default_o);
}
- post_process();
#if ENABLE_FEATURE_SHOW_THREADS
if (opt & OPT_T)
need_flags |= PSSCAN_TASKS;
if (--terminal_width > MAX_WIDTH)
terminal_width = MAX_WIDTH;
}
+ alloc_line_buffer();
format_header();
p = NULL;