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
185f9c1c
Commit
185f9c1c
authored
Apr 28, 2014
by
Damien George
Browse files
py: Fix lexerunix, where not all data may be read from a file.
Addresses issue #526.
parent
0c8fcb9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/lexerunix.c
View file @
185f9c1c
...
...
@@ -22,11 +22,12 @@ typedef struct _mp_lexer_file_buf_t {
STATIC
unichar
file_buf_next_char
(
mp_lexer_file_buf_t
*
fb
)
{
if
(
fb
->
pos
>=
fb
->
len
)
{
if
(
fb
->
len
<
sizeof
(
fb
->
buf
)
)
{
if
(
fb
->
len
==
0
)
{
return
MP_LEXER_CHAR_EOF
;
}
else
{
int
n
=
read
(
fb
->
fd
,
fb
->
buf
,
sizeof
(
fb
->
buf
));
if
(
n
<=
0
)
{
fb
->
len
=
0
;
return
MP_LEXER_CHAR_EOF
;
}
fb
->
len
=
n
;
...
...
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