{
if ((handlers_sets & SET_RESET_TERM) != 0) {
/* sparc and other have broken termios support: use old termio handling. */
- setTermSettings(fileno(stdin), (void *) &initial_settings);
+ setTermSettings(STDIN_FILENO, (void *) &initial_settings);
handlers_sets &= ~SET_RESET_TERM;
}
if ((handlers_sets & SET_WCHG_HANDLERS) != 0) {
/*
* This function is used to grab a character buffer
* from the input file descriptor and allows you to
- * a string with full command editing (sortof like
+ * a string with full command editing (sort of like
* a mini readline).
*
* The following standard commands are not implemented:
put_prompt();
#else
len = 0;
- break_out = -1; /* for control traps */
+ break_out = -1; /* to control traps */
#endif
break;
case 4:
/* cmdedit_reset_term() called in atexit */
exit(EXIT_SUCCESS);
#else
- len = break_out = -1; /* for control stoped jobs */
+ /* to control stopped jobs */
+ len = break_out = -1;
break;
#endif
} else {
break;
case '1':
case 'H':
- /* Home (Ctrl-A) */
+ /* <Home> */
input_backward(cursor);
break;
case '4':
case 'F':
- /* End (Ctrl-E) */
+ /* <End> */
input_end();
break;
default:
#if MAX_HISTORY >= 1
/* Handle command history log */
/* cleanup may be saved current command line */
- free(history[MAX_HISTORY]);
- history[MAX_HISTORY] = 0;
if (len> 0) { /* no put empty line */
int i = n_history;
+
+ free(history[MAX_HISTORY]);
+ history[MAX_HISTORY] = 0;
/* After max history, remove the oldest command */
if (i >= MAX_HISTORY) {
free(history[0]);