aboutsummaryrefslogtreecommitdiff
path: root/tests/shell.nix
diff options
context:
space:
mode:
authorLily Ballard <lily@sb.org>2020-11-24 14:12:32 -0800
committerLily Ballard <lily@sb.org>2020-11-24 15:08:37 -0800
commit437189e446e16399d347e4430c4d115b4cf2ddf1 (patch)
treeeaff0fc7e3e5efaa9aaed60908f07eaef50880b9 /tests/shell.nix
parent605bacdc929db4d820b8d5866450de7d1ec6e6cf (diff)
Escape filename given to nix-shell in shebang mode
This prevents spaces or other metacharacters from causing nix-shell to execute the wrong path. Fixes #4229.
Diffstat (limited to 'tests/shell.nix')
-rw-r--r--tests/shell.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/shell.nix b/tests/shell.nix
index 6ce59b416..24ebcc04c 100644
--- a/tests/shell.nix
+++ b/tests/shell.nix
@@ -50,7 +50,7 @@ let pkgs = rec {
# ruby "interpreter" that outputs "$@"
ruby = runCommand "ruby" {} ''
mkdir -p $out/bin
- echo 'printf -- "$*"' > $out/bin/ruby
+ echo 'printf %s "$*"' > $out/bin/ruby
chmod a+rx $out/bin/ruby
'';