diff options
| author | Artyom Poptsov <poptsov.artyom@gmail.com> | 2014-01-20 23:03:35 +0400 |
|---|---|---|
| committer | Artyom Poptsov <poptsov.artyom@gmail.com> | 2014-01-20 23:03:35 +0400 |
| commit | 4e9d6f65840419a0015eff4a99858dfb60b88eed (patch) | |
| tree | 98b70d2fff1661cee00855f929931cbda9fc5402 /examples/echo | |
| parent | examples/echo/server.scm: Handle command-line options. (diff) | |
| download | guile-ssh-4e9d6f65840419a0015eff4a99858dfb60b88eed.tar.gz | |
examples/echo/{server,client}.scm (read-all): Fix a bug.
* examples/echo/server.scm (read-all): Fix a bug: return the first
read line if there is no more data to read.
* examples/echo/client.scm (read-all): Likewise.
Diffstat (limited to 'examples/echo')
| -rwxr-xr-x | examples/echo/client.scm | 4 | ||||
| -rwxr-xr-x | examples/echo/server.scm | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/echo/client.scm b/examples/echo/client.scm index 15ec1cd..1ac1d36 100755 --- a/examples/echo/client.scm +++ b/examples/echo/client.scm @@ -97,8 +97,8 @@ errors." (define (read-all port) "Read all lines from the PORT." - (let r ((res "") - (str (read-line port 'concat))) + (let r ((res (read-line port 'concat)) + (str "")) (if (not (eof-object? str)) (r (string-append res str) (read-line port 'concat)) res))) diff --git a/examples/echo/server.scm b/examples/echo/server.scm index e89db57..c10ccd0 100755 --- a/examples/echo/server.scm +++ b/examples/echo/server.scm @@ -114,8 +114,8 @@ (define (read-all port) "Read all lines from the PORT." - (let r ((res "") - (str (read-line port 'concat))) + (let r ((res (read-line port 'concat)) + (str "")) (if (and (not (eof-object? str)) (char-ready? port)) (r (string-append res str) (read-line port 'concat)) res))) |
