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

Introduce newmlarg as alternative to mlreply.

Rewrite gotoline accordingly.
This commit is contained in:
2015-09-29 10:43:19 +08:00
parent 198980b81f
commit 7f5f0dd7b3
3 changed files with 16 additions and 10 deletions

21
basic.c
View File

@@ -90,25 +90,26 @@ int gotoeol(int f, int n)
*
* @n: The specified line position at the current buffer.
*/
int gotoline(int f, int n)
{
int status ;
char arg[ NSTRING] ; /* Buffer to hold argument. */
int gotoline( int f, int n) {
/* Get an argument if one doesnt exist. */
if( f == FALSE) {
status = mlreply( "Line to GOTO: ", arg, sizeof arg) ;
int status ;
char *arg ; /* Buffer to hold argument. */
status = newmlarg( &arg, "Line to GOTO: ", 0) ;
if( status != TRUE) {
mloutstr( "(Aborted)") ;
return status ;
}
n = atoi( arg) ;
free( arg) ;
}
/* Handle the case where the user may be passed something like this:
* em filename +
* In this case we just go to the end of the buffer.
*/
/* Handle the case where the user may be passed something like this:
* em filename +
* In this case we just go to the end of the buffer.
*/
if (n == 0)
return gotoeob(f, n);