From a7fd28ee34353eac9502782ceb0ed3961026f284 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Fri, 26 Jan 2018 22:25:23 +0100 Subject: Fix ordering of (= x y) redirection EPF Thanks to Diego "dieggsy" for pointing out this incongruity with scsh-process. --- scsh-process.scm | 2 +- tests/run.scm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scsh-process.scm b/scsh-process.scm index 88404a9..c5a286c 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -432,7 +432,7 @@ (fd-to (if (port? fd/port-to) (port->fileno fd/port-to) fd/port-to))) - (duplicate-fileno ?fd-from fd-to))) + (duplicate-fileno fd-to ?fd-from))) ((_ (- ?fd/port)) (let ((o `?fd/port)) (cond diff --git a/tests/run.scm b/tests/run.scm index 7690752..96d49eb 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -85,6 +85,11 @@ ;; process's stderr (run/string (sh -c "echo 'hi, there' >&2"))) + ;; Reported by Diego "dieggsy" + (test "Simple run/string and stderr dup()ed to stdout" + "hi, there\n" + (run/string (sh -c "echo 'hi, there' >&2") (= 2 1))) + (test "Unquote-splicing run/string" "hi, there\n" (run/string (echo ,@(list "hi," "there")))) -- cgit v1.2.3