1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-09-26 07:04:00 -04:00

Review getnewtoken, introduce getnewtokval and rewrite function evaluation accordingly.

This commit is contained in:
2015-09-27 21:11:51 +08:00
parent b5eb424ad0
commit cfa5c7fb65
4 changed files with 88 additions and 59 deletions

12
bind.c
View File

@@ -11,6 +11,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "estruct.h"
@@ -439,12 +440,15 @@ static unsigned int getckey( int mflag) {
/* check to see if we are executing a command line */
if( clexec) {
char tok[ NSTRING] ; /* command incoming */
if( TRUE != gettokval( tok, sizeof tok)) /* get the next token */
char *tok ; /* command incoming */
tok = getnewtokval() ; /* get the next token */
if( tok == NULL)
c = 0 ; /* return dummy key on failure */
else
else {
c = stock( tok) ;
free( tok) ;
}
} else { /* or the normal way */
if( mflag)
c = get1key() ;