top: generalize handling of questionable rcfile issues

Previously top would warn users if an older version of
an rcfile was about to be overwritten. That's assuming
that RCFILE_NOERR was not defined. This left, however,
other potential rcfile issues or questions unattended.

For example, if a faulty 'inspect' redirected echo had
overwritten all window entries or if the inspect entry
was not 'pipe' or 'file' (actually, just a 'p' or 'f')
then top would silently accept it but look no further.

With this commit top will try to process every inspect
entry, while preserving unrecognized entries. Plus all
other non-fatal rcfile errors will now alert a user to
the potential overwrite when the 'W' command is given.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2012-12-02 00:00:00 -06:00
committed by Craig Small
parent a99f410d41
commit 8292f7b8ec
3 changed files with 21 additions and 20 deletions

View File

@ -49,7 +49,6 @@
//#define TREE_NORESET /* sort keys do NOT force forest view OFF */
//#define USE_X_COLHDR /* emphasize header vs. whole col, for 'x' */
//#define VALIDATE_NLS /* validate integrity of all 3 nls tables */
//#define WARN_CFG_OFF /* warning OFF when overwriting old rcfile */
/*###### Notes, etc. ###################################################*/