mirror of
https://github.com/janet-lang/janet
synced 2024-11-29 03:19:54 +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));
|
return janet_wrap_integer(WEXITSTATUS(status));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} 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;
|
iof->flags |= JANET_FILE_CLOSED;
|
||||||
return janet_wrap_nil();
|
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");
|
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++;
|
index++;
|
||||||
if (index < view->size) {
|
if (index < view->size) {
|
||||||
return janet_wrap_number((double) index);
|
return janet_wrap_number((double) index);
|
||||||
|
Loading…
Reference in New Issue
Block a user