diff options
| author | Damien George <damien.p.george@gmail.com> | 2015-01-29 13:57:23 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2015-01-29 13:57:23 +0000 |
| commit | 827b0f747b2aa4870ef8de90cb0c3a4151e5ce71 (patch) | |
| tree | e424b2e3c4a4e2f63ac125e42c502d887d5827fc /stmhal/pyexec.c | |
| parent | 26c0b155fa35d6518d985ed461a6f453a0afd4f4 (diff) | |
py: Change vstr_null_terminate -> vstr_null_terminated_str, returns str.
Diffstat (limited to 'stmhal/pyexec.c')
| -rw-r--r-- | stmhal/pyexec.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/stmhal/pyexec.c b/stmhal/pyexec.c index 930c1c019..eaad6b5d7 100644 --- a/stmhal/pyexec.c +++ b/stmhal/pyexec.c @@ -248,8 +248,7 @@ int pyexec_friendly_repl_process_char(int c) { return 0; } - vstr_null_terminate(&repl.line); - if (!mp_repl_continue_with_input(vstr_str(&repl.line))) { + if (!mp_repl_continue_with_input(vstr_null_terminated_str(&repl.line))) { goto exec; } @@ -275,8 +274,7 @@ int pyexec_friendly_repl_process_char(int c) { return 0; } - vstr_null_terminate(&repl.line); - if (mp_repl_continue_with_input(vstr_str(&repl.line))) { + if (mp_repl_continue_with_input(vstr_null_terminated_str(&repl.line))) { vstr_add_byte(&repl.line, '\n'); stdout_tx_str("... "); readline_note_newline(); @@ -364,11 +362,7 @@ friendly_repl_reset: continue; } - for (;;) { - vstr_null_terminate(&line); - if (!mp_repl_continue_with_input(vstr_str(&line))) { - break; - } + while (mp_repl_continue_with_input(vstr_null_terminated_str(&line))) { vstr_add_byte(&line, '\n'); ret = readline(&line, "... "); if (ret == CHAR_CTRL_C) { |
