1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-16 07:45:23 +00:00

Mode commands based on newmlarg (replacement of mlreply).

This commit is contained in:
Renaud 2015-10-01 08:19:39 +08:00
parent 575659b1c1
commit db30d6d734

View File

@ -944,7 +944,7 @@ static int adjustmode( int kind, int global) {
unsigned i ; /* loop index */ unsigned i ; /* loop index */
int status; /* error return on input */ int status; /* error return on input */
char prompt[50]; /* string to prompt user with */ char prompt[50]; /* string to prompt user with */
char cbuf[ NSTRING] ; /* buffer to recieve mode name into */ char *cbuf ; /* buffer to recieve mode name into */
/* build the proper prompt string */ /* build the proper prompt string */
if (global) if (global)
@ -959,7 +959,7 @@ static int adjustmode( int kind, int global) {
/* prompt the user and get an answer */ /* prompt the user and get an answer */
status = mlreply( prompt, cbuf, sizeof cbuf - 1) ; status = newmlarg( &cbuf, prompt, 0) ;
if (status != TRUE) if (status != TRUE)
return status; return status;
@ -987,6 +987,7 @@ static int adjustmode( int kind, int global) {
curwp->w_flag |= WFCOLR; curwp->w_flag |= WFCOLR;
#endif #endif
mlerase(); mlerase();
free( cbuf) ;
return TRUE; return TRUE;
} }
} }
@ -1009,11 +1010,13 @@ static int adjustmode( int kind, int global) {
if (global == 0) if (global == 0)
upmode(); upmode();
mlerase(); /* erase the junk */ mlerase(); /* erase the junk */
free( cbuf) ;
return TRUE; return TRUE;
} }
} }
mlwrite("No such mode!"); mlwrite("No such mode!");
free( cbuf) ;
return FALSE; return FALSE;
} }