diff --git a/eval.c b/eval.c index 7e5c685..01e2c44 100644 --- a/eval.c +++ b/eval.c @@ -1172,7 +1172,7 @@ char *getval(char *token) strcpy(token, getval(&token[1])); distmp = discmd; /* echo it always! */ discmd = TRUE; - status = getstring(token, buf, NSTRING, ctoec('\n')); + status = getstring( token, buf, NSTRING, nlc) ; discmd = distmp; if (status == ABORT) return errorm; diff --git a/exec.c b/exec.c index 09a1cd1..dec8f3b 100644 --- a/exec.c +++ b/exec.c @@ -298,7 +298,7 @@ int macarg( char *tok, int toksz) savcle = clexec; /* save execution mode */ clexec = TRUE; /* get the argument */ - status = nextarg("", tok, toksz, ctoec('\n')); + status = mlreply( "", tok, toksz) ; clexec = savcle; /* restore execution mode */ return status; } diff --git a/input.c b/input.c index d8637d3..5e4e960 100644 --- a/input.c +++ b/input.c @@ -52,6 +52,8 @@ int ctlxc = CONTROL | 'X' ; /* current control X prefix char */ int reptc = CONTROL | 'U' ; /* current universal repeat char */ int abortc = CONTROL | 'G' ; /* current abort command char */ +const int nlc = CONTROL | 'J' ; /* end of input char */ + static const int quotec = 0x11 ; /* quote char during mlreply() */ static void outstring( char *s) ; @@ -91,14 +93,12 @@ int mlyesno( const char *prompt) * return. Handle erase, kill, and abort keys. */ -int mlreply( const char *prompt, char *buf, int nbuf) -{ - return nextarg(prompt, buf, nbuf, ctoec('\n')); +int mlreply( const char *prompt, char *buf, int nbuf) { + return nextarg( prompt, buf, nbuf, nlc) ; } -int mlreplyt(const char *prompt, char *buf, int nbuf, int eolchar) -{ - return nextarg(prompt, buf, nbuf, eolchar); +int mlreplyt( const char *prompt, char *buf, int nbuf) { + return nextarg( prompt, buf, nbuf, metac) ; } /* @@ -115,18 +115,6 @@ int ectoc(int c) return c; } -/* - * ctoec: - * character to extended character - * pull out the CONTROL and SPEC prefixes (if possible) - */ -int ctoec(int c) -{ - if (c >= 0x00 && c <= 0x1F) - c = CONTROL | (c + '@'); - return c; -} - /* * get a command name from the command line. Command completion means * that pressing a will attempt to complete an unfinished command diff --git a/input.h b/input.h index 03aa106..fffd38c 100644 --- a/input.h +++ b/input.h @@ -14,17 +14,18 @@ extern int kbdm[] ; /* Holds kayboard macro data */ extern int *kbdptr ; /* current position in keyboard buf */ extern int *kbdend ; /* ptr to end of the keyboard */ extern int disinp ; /* display input characters */ + extern int metac; /* current meta character */ extern int ctlxc; /* current control X prefix char */ extern int reptc; /* current universal repeat char */ extern int abortc; /* current abort command char */ +extern const int nlc ; /* end of input char */ int mlyesno( const char *prompt) ; int mlreply( const char *prompt, char *buf, int nbuf) ; -int mlreplyt( const char *prompt, char *buf, int nbuf, int eolchar) ; +int mlreplyt( const char *prompt, char *buf, int nbuf) ; int ectoc( int c) ; -int ctoec( int c) ; fn_t getname( void) ; int tgetc( void) ; int get1key( void) ; diff --git a/random.c b/random.c index 2ecc43a..b791898 100644 --- a/random.c +++ b/random.c @@ -1196,7 +1196,7 @@ int istring(int f, int n) /* ask for string to insert */ status = - mlreplyt("String to insert: ", tstring, sizeof tstring - 1, metac) ; + mlreplyt( "String to insert: ", tstring, sizeof tstring - 1) ; if (status != TRUE) return status; @@ -1224,7 +1224,7 @@ int ovstring(int f, int n) /* ask for string to insert */ status = - mlreplyt( "String to overwrite: ", tstring, NSTRING, metac) ; + mlreplyt( "String to overwrite: ", tstring, NSTRING) ; if (status != TRUE) return status; diff --git a/search.c b/search.c index ee9091f..be4b871 100644 --- a/search.c +++ b/search.c @@ -713,7 +713,8 @@ static int readpattern(char *prompt, char *apat, int srch) * Then, if it's the search string, make a reversed pattern. * *Then*, make the meta-pattern, if we are defined that way. */ - if ((status = mlreplyt(tpat, tpat, NPAT, metac)) == TRUE) { + status = mlreplyt( tpat, tpat, NPAT) ; + if( status == TRUE) { strcpy(apat, tpat); if (srch) { /* If we are doing the search string. */ /* Reverse string copy, and remember