Rewrite `read-line' in terms of `scm_getc'.
authorLudovic Courtès <ludo@gnu.org>
Tue, 25 Jan 2011 23:24:34 +0000 (00:24 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 25 Jan 2011 23:29:51 +0000 (00:29 +0100)
commita2c36371ce3de246bdb892afd50915ecf450df47
tree2567b2edf7f203725492b4bac834e187a7640621
parentcc540d0bbd4595be32d760bfd6e9e5ec3cdbd3d3
Rewrite `read-line' in terms of `scm_getc'.

As a result `read-line' handles decoding and decoding errors the same
way as `scm_getc'.  It's also simpler and free of `malloc' calls.

* libguile/rdelim.c (scm_do_read_line): Remove.
  (scm_read_line): Rewrite as a loop that calls `scm_getc'.

* test-suite/tests/rdelim.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add `tests/rdelim.test'.
libguile/rdelim.c
test-suite/Makefile.am
test-suite/tests/rdelim.test [new file with mode: 0644]