From 575659b1c127036b3bb2aaff18a2498f0a94c674 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Thu, 1 Oct 2015 08:03:14 +0800 Subject: [PATCH] apropos based on newmlarg (replacement of mlreply). --- bind.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bind.c b/bind.c index 342a1ea..60a552c 100644 --- a/bind.c +++ b/bind.c @@ -274,23 +274,24 @@ static int unbindchar( unsigned c) { * bring up a fake buffer and list the key bindings * into it with view mode */ -int desbind(int f, int n) +int desbind( int f, int n) { #if APROP -{ - buildlist( "") ; - return TRUE; + return buildlist( "") ; } -int apro(int f, int n) -{ /* Apropos (List functions that match a substring) */ - char mstring[NSTRING]; /* string to match cmd names to */ - int status; /* status return */ +/* Apropos (List functions that match a substring) */ +int apro( int f, int n) { + char *mstring ; /* string to match cmd names to */ + int status ; /* status return */ - status = mlreply("Apropos string: ", mstring, NSTRING - 1); - if (status == ABORT) - return status; + status = newmlarg( &mstring, "Apropos string: ", 0) ; + if( status == TRUE) { + status = buildlist( mstring) ; + free( mstring) ; + } else if( status == FALSE) + status = buildlist( "") ; /* build list of all commands */ - return buildlist( mstring) ; + return status ; } /* @@ -298,9 +299,8 @@ int apro(int f, int n) * * char *mstring; match string if a partial list, "" matches all */ -static int buildlist( char *mstring) +static int buildlist( char *mstring) { #endif -{ struct window *wp; /* scanning pointer to windows */ struct key_tab *ktp; /* pointer into the command table */ struct name_bind *nptr; /* pointer into the name binding table */