IO/FS/read_line never ends when reading last line with bend run-c #638
Labels
bug
Something isn't working
good first issue
Good for newcomers
prelude
Bend's builtin types and functions
Milestone
Reproducing the behavior
It seems that the function have a problem reading the value from the last line, maybe because it cant find the "\n" it searches for.
Example of source file used, (there are 3 lines, the last line is not empty):
If I run this program using "bend runc-c":
I get:
If I uncomment the last read_line, calling read 3 times, the program seems to never end.
It seems it have other behaviors for "bend run" for example.
System Settings
Additional context
I guess the change can be made in the builtin's. Could change the generic Bytes/split_once to a Bytes/split_next_line that uses a condition to check for '\n' and EOF, but I didn't quite catch how that would work here:
The text was updated successfully, but these errors were encountered: