Skip to content

Commit

Permalink
Fix regression: checking abort when prompting for command name.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfivet committed Jul 21, 2021
1 parent c093b70 commit 6f7d89b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,19 @@ int deskey( int f, int n) {
*
* int f, n; command arguments [IGNORED]
*/
int bindtokey(int f, int n) {
int bindtokey( int f, int n) {
key_tab *ktp ; /* pointer into the command table */
char outseq[ 80] ; /* output buffer for keystroke sequence */

/* prompt the user to type in a key to bind */
mlwrite(": bind-to-key ");

/* get the function name to bind it to */
fnp_t kfunc = getname()->n_func ;
const name_bind *nbp = getname() ;
if( nbp == NULL) /* abort */
return FALSE ;

fnp_t kfunc = nbp->n_func ;
if( kfunc == NULL) {
mlwrite( "(No such function)") ;
return FALSE ;
Expand Down
7 changes: 5 additions & 2 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ static int macarg( char *tok, int toksz) ;
*/
int namedcmd( int f, int n) {
/* prompt the user to type a named command */
mlwrite(": ");
mlwrite(": execute-named-cmd ");

/* and now get the function name to execute */
const name_bind *nbp = getname() ;
if( nbp == NULL) /* abort */
return FALSE ;

fnp_t kfunc = nbp->n_func ;
if (kfunc == NULL) {
mlwrite("(No such function)");
Expand Down Expand Up @@ -118,7 +121,7 @@ int execcmd( int f, int n) {
char *cmdstr ; /* string holding command to execute */

/* get the line wanted */
status = newmlarg( &cmdstr, ": ", 0) ;
status = newmlarg( &cmdstr, ": execute-command-line ", 0) ;
if( status != TRUE)
return status ;

Expand Down

0 comments on commit 6f7d89b

Please sign in to comment.