From b6373368fc738f43a0662545956a444da394425f Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Thu, 31 Jul 2014 23:52:20 -0700
Subject: [PATCH] Implement CLEAR-OUTPUT for FD-STREAM's.

This appears to be a very old bug where clear-output didn't clear the
output for fd-streams.
---
 src/code/fd-stream.lisp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp
index 80e294141..470dfe23e 100644
--- a/src/code/fd-stream.lisp
+++ b/src/code/fd-stream.lisp
@@ -1682,7 +1682,9 @@
 	   nil
 	   (values (truncate size (fd-stream-element-size stream))))))
     (:file-position
-     (fd-stream-file-position stream arg1))))
+     (fd-stream-file-position stream arg1))
+    (:clear-output
+     (setf (fd-stream-obuf-tail stream) 0))))
 
 
 ;;; FD-STREAM-FILE-POSITION -- internal.
-- 
GitLab