diff --git a/NEWS b/NEWS index 4e0e0f9d..a6001bea 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ procps-ng NEXT -------------- * pgrep: Check sanity of SG_ARG_MAX issue #152 + * top: ensure config file backward compatibility Debian #951335 procps-ng-3.3.16 ---------------- diff --git a/top/top.c b/top/top.c index 63ec5fe0..b4fe21e4 100644 --- a/top/top.c +++ b/top/top.c @@ -3939,11 +3939,6 @@ static const char *configs_file (FILE *fp, const char *name, float *delay) { // too bad fscanf is not as flexible with his format string as snprintf #error Hey, fix the above fscanf 'PFLAGSSIZ' dependency ! #endif - // ensure there's been no manual alteration of fieldscur - for (n = 0 ; n < EU_MAXPFLGS; n++) { - if (&w->rc.fieldscur[n] != strrchr(w->rc.fieldscur, w->rc.fieldscur[n])) - return p; - } // be tolerant of missing release 3.3.10 graph modes additions if (3 > fscanf(fp, "\twinflags=%d, sortindx=%d, maxtasks=%d, graph_cpus=%d, graph_mems=%d\n" , &w->rc.winflags, &w->rc.sortindx, &w->rc.maxtasks, &w->rc.graph_cpus, &w->rc.graph_mems)) @@ -3989,6 +3984,11 @@ static const char *configs_file (FILE *fp, const char *name, float *delay) { return p; break; } + // ensure there's been no manual alteration of fieldscur + for (n = 0 ; n < EU_MAXPFLGS; n++) { + if (&w->rc.fieldscur[n] != strrchr(w->rc.fieldscur, w->rc.fieldscur[n])) + return p; + } #ifndef USE_X_COLHDR OFFw(w, NOHIFND_xxx | NOHISEL_xxx); #endif