Skip to content

Commit

Permalink
cosmetic: move process-output before first use
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
  • Loading branch information
dkochmanski authored and sionescu committed Aug 3, 2015
1 parent 5b54cf6 commit b3c144c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions grovel/invoke.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
(integer ret))
"<see above>")))

(defun process-output (process-stream)
(with-open-stream (process-stream process-stream)
(with-output-to-string (str)
(loop for char = (read-char process-stream nil)
while char
do (write-char char str)))))

#+ecl
(defun %invoke (command arglist)
(multiple-value-bind (output-stream exit-code)
Expand All @@ -67,13 +74,6 @@
(values exit-code
(process-output output-stream))))

(defun process-output (process-stream)
(with-open-stream (process-stream process-stream)
(with-output-to-string (str)
(loop for char = (read-char process-stream nil)
while char
do (write-char char str)))))

#+(or cmu scl)
(defun %invoke (command arglist)
(let* ((process (ext:run-program command arglist
Expand Down

0 comments on commit b3c144c

Please sign in to comment.