[readline] Add replace_string()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-03-29 16:40:23 +01:00
parent 6a6dd5c452
commit d6f2408f2c
2 changed files with 13 additions and 0 deletions

View File

@@ -117,6 +117,17 @@ static void kill_eol ( struct edit_string *string ) {
insert_delete ( string, ~( ( size_t ) 0 ), NULL );
}
/**
* Replace editable string
*
* @v string Editable string
* @v replacement Replacement string
*/
void replace_string ( struct edit_string *string, const char *replacement ) {
string->cursor = 0;
insert_delete ( string, ~( ( size_t ) 0 ), replacement );
}
/**
* Edit editable string
*