diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f223dca..1a473fa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Bug Fixes +- Fixed an off-by-one error in `read-line` where the function erroneously reported an extra character was read from `stdin`. Thanks to wasamasa for the bug report. - Fixed a CPS optimization issue where multiple copies of the same lambda are introduced during beta expansion, which causes the optimizer to potentially pick up the wrong value when optimizing-out function calls later on. Thanks to @Chant on Github for providing the report and a test program demonstrating the issue. ## 0.7.2 - February 15, 2018 diff --git a/runtime.c b/runtime.c index 826775b3..b52b3ce5 100644 --- a/runtime.c +++ b/runtime.c @@ -6629,6 +6629,7 @@ object Cyc_io_read_line(void *data, object cont, object port) while (len > 0 && (buf[len - 1] == '\n' || buf[len - 1] == '\r')) { len--; + num_cp--; } buf[len] = '\0'; make_string_noalloc(s, buf, len);