mirror of
https://github.com/janet-lang/janet
synced 2024-11-28 19:19:53 +00:00
Merge branch 'master' into ev
This commit is contained in:
commit
71d8e6b4cd
@ -279,7 +279,10 @@ static Janet cfun_io_fclose(int32_t argc, Janet *argv) {
|
||||
return janet_wrap_integer(WEXITSTATUS(status));
|
||||
#endif
|
||||
} else {
|
||||
if (fclose(iof->file)) janet_panic("could not close file");
|
||||
if (fclose(iof->file)) {
|
||||
iof->flags |= JANET_FILE_NOT_CLOSEABLE;
|
||||
janet_panic("could not close file");
|
||||
}
|
||||
iof->flags |= JANET_FILE_CLOSED;
|
||||
return janet_wrap_nil();
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ static Janet ta_view_next(void *p, Janet key) {
|
||||
}
|
||||
}
|
||||
if (!janet_checksize(key)) janet_panic("expected size as key");
|
||||
size_t index = janet_unwrap_number(key);
|
||||
size_t index = (size_t) janet_unwrap_number(key);
|
||||
index++;
|
||||
if (index < view->size) {
|
||||
return janet_wrap_number((double) index);
|
||||
|
Loading…
Reference in New Issue
Block a user