Change default line translation for TCP stream sockets. These almost
authorChris Hanson <org/chris-hanson/cph>
Sat, 1 Nov 1997 19:12:16 +0000 (19:12 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 1 Nov 1997 19:12:16 +0000 (19:12 +0000)
always use CR/LF, regardless of the operating system.

v7/src/runtime/io.scm

index eb9f9a46bb49212afe6e01914098b4ea72f906d1..fda662aa3a727c02b0a3ff2322960f2e26dfa875 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: io.scm,v 14.50 1997/05/19 17:37:43 cph Exp $
+$Id: io.scm,v 14.51 1997/11/01 19:12:16 cph Exp $
 
 Copyright (c) 1988-97 Massachusetts Institute of Technology
 
@@ -601,7 +601,9 @@ MIT in each case. |#
         (if (or (default-object? line-translation)
                 ;; Kludge because of DEFAULT-OBJECT?:
                 (eq? 'DEFAULT line-translation))
-            (os/default-end-of-line-translation)
+            (if (eq? 'TCP-STREAM-SOCKET (channel-type channel))
+                "\r\n"
+                (os/default-end-of-line-translation))
             line-translation)))
     (with-values (lambda () (output-buffer-sizes translation buffer-size))
       (lambda (logical-size string-size)
@@ -777,7 +779,9 @@ MIT in each case. |#
          (if (or (default-object? line-translation)
                  ;; Kludge because of DEFAULT-OBJECT?:
                  (eq? 'DEFAULT line-translation))
-             (os/default-end-of-line-translation)
+             (if (eq? 'TCP-STREAM-SOCKET (channel-type channel))
+                 "\r\n"
+                 (os/default-end-of-line-translation))
              line-translation))
         (string-size (input-buffer-size translation buffer-size)))
     (%make-input-buffer channel