Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
2b2cb7b7
Commit
2b2cb7b7
authored
Jan 24, 2014
by
Paul Sokolovsky
Browse files
unix main: Free input line.
Also, readline uses system malloc, so for symmetry, use the same for non-readline case.
parent
39763c6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/main.c
View file @
2b2cb7b7
...
...
@@ -112,7 +112,7 @@ static char *prompt(char *p) {
}
else
{
l
++
;
}
char
*
line
=
m
_new
(
char
,
l
);
char
*
line
=
m
alloc
(
l
);
memcpy
(
line
,
buf
,
l
);
#endif
return
line
;
...
...
@@ -140,6 +140,7 @@ static void do_repl(void) {
mp_lexer_t
*
lex
=
mp_lexer_new_from_str_len
(
"<stdin>"
,
line
,
strlen
(
line
),
false
);
execute_from_lexer
(
lex
,
MP_PARSE_SINGLE_INPUT
,
true
);
free
(
line
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment