diff options
| author | Michael Brown | 2011-03-29 17:40:23 +0200 |
|---|---|---|
| committer | Michael Brown | 2011-03-30 20:26:48 +0200 |
| commit | d6f2408f2cf8abce51bb70f5ff2a2989818f0025 (patch) | |
| tree | 5bda6666db176cce440ea4cb64be8f8252e22f68 /src/hci/editstring.c | |
| parent | [readline] Add init_editstring() wrapper function (diff) | |
| download | ipxe-d6f2408f2cf8abce51bb70f5ff2a2989818f0025.tar.gz ipxe-d6f2408f2cf8abce51bb70f5ff2a2989818f0025.tar.xz ipxe-d6f2408f2cf8abce51bb70f5ff2a2989818f0025.zip | |
[readline] Add replace_string()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/editstring.c')
| -rw-r--r-- | src/hci/editstring.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hci/editstring.c b/src/hci/editstring.c index 9207e58a7..996528ff5 100644 --- a/src/hci/editstring.c +++ b/src/hci/editstring.c @@ -118,6 +118,17 @@ static void kill_eol ( struct edit_string *string ) { } /** + * 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 * * @v string Editable string |
