summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMike Gran <spk121@yahoo.com>2021-03-11 19:42:33 -0800
committerMike Gran <spk121@yahoo.com>2021-03-11 19:42:33 -0800
commit0f983e3db0c43ad7c89f57ea84f792ede373ba0c (patch)
treea56172dd2fac12e2ba9d9eeafeabfd3ea95cad56 /doc
parenta744f98dcc294ab2cbe1cb5ce4efa66665f4e03f (diff)
downloadguile-0f983e3db0c43ad7c89f57ea84f792ede373ba0c.tar.gz
Handle CRLF and Unicode line endings in read-line
* libguile/rdelim.c (scm_read_line): handle CRLF, LS and PS * module/ice-9/suspendable-ports.scm (read-line): handle CRLF, LS, and PS * module/web/http.scm (read-header-line): take advantage of CRLF in read-line (read-header): don't need to test for \return * test-suite/tests/rdelim.test: new tests for read-line CRLF, LS and PS * doc/ref/api-io.texi: update doc for read-line
Diffstat (limited to 'doc')
-rw-r--r--doc/ref/api-io.texi10
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi
index 777f282e9..2345f043c 100644
--- a/doc/ref/api-io.texi
+++ b/doc/ref/api-io.texi
@@ -755,8 +755,10 @@ a specified set of characters.
@deffn {Scheme Procedure} read-line [port] [handle-delim]
Return a line of text from @var{port} if specified, otherwise from the
-value returned by @code{(current-input-port)}. Under Unix, a line of text
-is terminated by the first end-of-line character or by end-of-file.
+value returned by @code{(current-input-port)}. Under Unix, a line of
+text is terminated by the first end-of-line character or by end-of-file.
+The end-of-line characters handled are newline, carriage return plus
+newline, or the Unicode line or paragraph separators.
If @var{handle-delim} is specified, it should be one of the following
symbols:
@@ -771,7 +773,9 @@ Append the terminating delimiter (if any) to the returned string.
Push the terminating delimiter (if any) back on to the port.
@item split
Return a pair containing the string read from the port and the
-terminating delimiter or end-of-file object.
+terminating delimiter or end-of-file object. The delimiter will either
+be a single character for newline or the Unicode line or paragraph
+separators, or it will be the string @code{"\r\n"}.
@end table
@end deffn