top: extend rcfile conversions for '--enable-oomem'

Under openSUSE, old top uses additional fields for
out-of-memory reporting.  As a result, under the
original approach to rcfile conversion, new top would
issue a fatal corrupt window entry message asking that
the rcfile be deleted.

This patch extends the conversion range to include
the extra openSUSE field characters.  It's effective
when ./configure specifies the --enable-oomem option
which in turn defines OOMEM_ENABLE.

This commit also makes the conversion logic slightly
more forgiving.  While enforcing an upper limit on the
expected number of old style field characters, amounts
less than that will be handled seemlessly.

Reference:
commit 4b98733132

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2012-03-02 12:34:56 -06:00
committed by Craig Small
parent 502a79e02f
commit 0053eefbb9
2 changed files with 66 additions and 39 deletions

View File

@ -493,8 +493,16 @@ typedef struct WIN_t {
#define JOB_FIELDS "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>()*+,-./012568>?@ABCFGHIJKLMNOPQRSTUVWXYZ["
#define MEM_FIELDS "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>&'()*+,-./0125689BFGHIJKLMNOPQRSTUVWXYZ["
#define USR_FIELDS "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ["
/* old top's fields (A-Z) in the first 26 positions */
#define OLD_FIELDS "%&*'(-0346789:;<=>?@ACDEFG)+,./125BHIJKLMNOPQRSTUVWXYZ["
#ifdef OOMEM_ENABLE
// the suse old top fields ( 'a'-'z' + '{|' ) in positions 0-27
// ( the extra chars above represent the 'off' state )
#define CVT_FIELDS "%&*'(-0346789:;<=>?@ACDEFGML)+,./125BHIJKNOPQRSTUVWXYZ["
#define CVT_FLDMAX 28
#else
// other old top fields ( 'a'-'z' ) in positions 0-25
#define CVT_FIELDS "%&*'(-0346789:;<=>?@ACDEFG)+,./125BHIJKLMNOPQRSTUVWXYZ["
#define CVT_FLDMAX 26
#endif
/* The default values for the local config file */
#define DEF_RCFILE { \