Skip to content

Commit a1c3bf9

Browse files
committed
Fix reversed input
1 parent c64d144 commit a1c3bf9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/stdin.lisp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ most cases of *query-io* usage. Makes overloading y-or-no-p unnecessary.
8282
(send-input-request channel trimmed-output)
8383
(loop until (message-available-p channel)
8484
do (sleep 0.1))
85-
(loop for ch across (gethash "value" (message-content (message-recv channel)))
85+
(loop with value = (gethash "value" (message-content (message-recv channel)))
86+
for i from (1- (length value)) downto 0
8687
initially (vector-push-extend #\Newline input)
87-
do (vector-push-extend ch input))))
88+
do (vector-push-extend (char value i) input))))
8889
(bordeaux-threads:release-lock lock)))))
8990

9091
(defmethod trivial-gray-streams:stream-clear-input ((stream stdin-stream))

0 commit comments

Comments
 (0)