summaryrefslogtreecommitdiffstatshomepage
path: root/lib/mp-readline
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-29 13:57:23 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-29 13:57:23 +0000
commit827b0f747b2aa4870ef8de90cb0c3a4151e5ce71 (patch)
treee424b2e3c4a4e2f63ac125e42c502d887d5827fc /lib/mp-readline
parent26c0b155fa35d6518d985ed461a6f453a0afd4f4 (diff)
downloadmicropython-827b0f747b2aa4870ef8de90cb0c3a4151e5ce71.tar.gz
micropython-827b0f747b2aa4870ef8de90cb0c3a4151e5ce71.zip
py: Change vstr_null_terminate -> vstr_null_terminated_str, returns str.
Diffstat (limited to 'lib/mp-readline')
-rw-r--r--lib/mp-readline/readline.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/mp-readline/readline.c b/lib/mp-readline/readline.c
index 0303ff36d5..2bbbc5385d 100644
--- a/lib/mp-readline/readline.c
+++ b/lib/mp-readline/readline.c
@@ -111,8 +111,7 @@ int readline_process_char(int c) {
if (rl.line->len > rl.orig_line_len && (MP_STATE_PORT(readline_hist)[0] == NULL || strcmp(MP_STATE_PORT(readline_hist)[0], rl.line->buf + rl.orig_line_len) != 0)) {
// a line which is not empty and different from the last one
// so update the history
- vstr_null_terminate(rl.line);
- char *most_recent_hist = str_dup_maybe(rl.line->buf + rl.orig_line_len);
+ char *most_recent_hist = str_dup_maybe(vstr_null_terminated_str(rl.line) + rl.orig_line_len);
if (most_recent_hist != NULL) {
for (int i = READLINE_HIST_SIZE - 1; i > 0; i--) {
MP_STATE_PORT(readline_hist)[i] = MP_STATE_PORT(readline_hist)[i - 1];