return -1 from get_code to indicate end of file (#1622)
This commit is contained in:
@@ -3058,11 +3058,10 @@ impl Machine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if stream.at_end_of_stream() {
|
if stream.at_end_of_stream() {
|
||||||
let end_of_file = atom!("end_of_file");
|
|
||||||
stream.set_past_end_of_stream(true);
|
stream.set_past_end_of_stream(true);
|
||||||
|
|
||||||
self.machine_st.unify_atom(
|
self.machine_st.unify_fixnum(
|
||||||
end_of_file,
|
Fixnum::build_with(-1),
|
||||||
self.machine_st.store(self.machine_st.deref(self.machine_st.registers[2])),
|
self.machine_st.store(self.machine_st.deref(self.machine_st.registers[2])),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user