diff --git a/scheme/std-command.scm b/scheme/std-command.scm index acb98d3..b3aeb7d 100644 --- a/scheme/std-command.scm +++ b/scheme/std-command.scm @@ -55,18 +55,20 @@ => lookup-env-var) (else str))) -(define (expand-string str) - (substitute-env-vars str)) +(define (expand-string/s-expr v) + (if (string? v) + (substitute-env-vars v) + v)) (define (expand-redirection redirection) (make-redirection (redirection-op redirection) - (expand-string (redirection-dest redirection)))) + (expand-string/s-expr (redirection-dest redirection)))) (define (expand-command command) - (let ((expanded (map expand-string (command-args command)))) + (let ((expanded (map expand-string/s-expr (command-args command)))) (make-command - (expand-string (command-executable command)) + (expand-string/s-expr (command-executable command)) (fold-right (lambda (arg args) (if (contains-glob-expression? arg)