top: remove residual logic for obsolete functionality
At one time the 'open_psdb_message' library call was supported with the concept of a postponed message which would display after top startup completed. In turn, that required logic to strip the '\n' which was embedded (inappropriately) in any such message. Nowdays top treats such a returned error as fatal so there is no need for the 'strim' function which is being removed with this commit. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
ee3ed4b45e
commit
045538e01b
15
top/top.c
15
top/top.c
@ -285,19 +285,6 @@ static inline char *scat (char *dst, const char *src) {
|
|||||||
} // end: scat
|
} // end: scat
|
||||||
|
|
||||||
|
|
||||||
#ifdef TERMIOS_ONLY
|
|
||||||
/*
|
|
||||||
* Trim line oriented input */
|
|
||||||
static char *strim (char *str) {
|
|
||||||
static const char ws[] = "\b\f\n\r\t\v\x1b\x9b"; // 0x1b + 0x9b are escape
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
if ((p = strpbrk(str, ws))) *p = '\0';
|
|
||||||
return str;
|
|
||||||
} // end: strim
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This guy just facilitates Batch and protects against dumb ttys
|
* This guy just facilitates Batch and protects against dumb ttys
|
||||||
* -- we'd 'inline' him but he's only called twice per frame,
|
* -- we'd 'inline' him but he's only called twice per frame,
|
||||||
@ -944,7 +931,7 @@ static char *linein (const char *prompt) {
|
|||||||
putp(Cap_curs_norm);
|
putp(Cap_curs_norm);
|
||||||
|
|
||||||
// note: we DO produce a vaid 'string'
|
// note: we DO produce a vaid 'string'
|
||||||
return strim(buf);
|
return buf;
|
||||||
} // end: linein
|
} // end: linein
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -537,9 +537,6 @@ typedef struct WIN_t {
|
|||||||
/*------ Tiny useful routine(s) ----------------------------------------*/
|
/*------ Tiny useful routine(s) ----------------------------------------*/
|
||||||
//atic const char *fmtmk (const char *fmts, ...);
|
//atic const char *fmtmk (const char *fmts, ...);
|
||||||
//atic inline char *scat (char *dst, const char *src);
|
//atic inline char *scat (char *dst, const char *src);
|
||||||
#ifdef TERMIOS_ONLY
|
|
||||||
//atic char *strim (char *str);
|
|
||||||
#endif
|
|
||||||
//atic const char *tg2 (int x, int y);
|
//atic const char *tg2 (int x, int y);
|
||||||
/*------ Exit/Interrput routines ---------------------------------------*/
|
/*------ Exit/Interrput routines ---------------------------------------*/
|
||||||
//atic void bye_bye (const char *str);
|
//atic void bye_bye (const char *str);
|
||||||
|
Loading…
Reference in New Issue
Block a user