* Functions which manipulate the command buffer.
* Used only by command() and related functions.
extern int erase_char
, kill_char
;
static char cmdbuf
[120]; /* Buffer for holding a multi-char command */
static int cmd_col
; /* Current column of the multi-char command */
static char *cp
; /* Pointer into cmdbuf */
* Reset command buffer (to empty).
* How many characters are in the command buffer?
* Backspace in the command buffer.
* Backspace past beginning of the string:
* this usually means abort the command.
* Process a single character of a multi-character command, such as
* a number, or the pattern of a search command.
} else if (c
== kill_char
)
/* {{ Could do this faster, but who cares? }} */
} else if (cp
>= &cmdbuf
[sizeof(cmdbuf
)-1])
* No room in the command buffer.
} else if (cmd_col
>= sc_width
-4)
* {{ Could get fancy here; maybe shift the displayed
* line and make room for more chars, like ksh. }}
* Append the character to the string.
* Return the number currently in the command buffer.
* Display a string, usually as a prompt for input into the command buffer.
* Return a pointer to the command buffer.