summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scsh-process.scm4
-rw-r--r--tests/run.scm5
2 files changed, 7 insertions, 2 deletions
diff --git a/scsh-process.scm b/scsh-process.scm
index b106bbf..a6d6e0b 100644
--- a/scsh-process.scm
+++ b/scsh-process.scm
@@ -11,7 +11,7 @@
;; WARNING: Don't mix with threading unless you're using
;; Chicken 4.8.1 rev 47b5be71 or later.
;;
-;;; Copyright (c) 2012-2020, Peter Bex
+;;; Copyright (c) 2012-2021, Peter Bex
;; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
@@ -364,7 +364,7 @@
(lambda ()
(file-close in)
(duplicate-fileno out 1)
- (with-output-to-port (open-output-file* out) thunk)))))
+ (with-output-to-port (open-output-file* 1) thunk)))))
(file-close out)
(open-input-file* in)))
diff --git a/tests/run.scm b/tests/run.scm
index c4ab584..b5fa419 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -107,6 +107,11 @@
"hi, there\n"
(run/string (sh -c "echo 'hi, there' >&2") (= 2 1)))
+ ;; Also reported by Diego "dieggsy"
+ (test "run/string where (begin) is piped to a program"
+ "1\n"
+ (run/string (pipe (begin (print "hey")) (wc -l))))
+
(test "Unquote-splicing run/string"
"hi, there\n"
(run/string (echo ,@(list "hi," "there"))))