From ca156a66b75999153d746f57a11a19222fd5cdfb Mon Sep 17 00:00:00 2001 From: Andrew Childs Date: Tue, 9 Feb 2021 12:51:42 +0900 Subject: stdenv/patchShebangs: fix off by one reading old interpreter This caused shebangs that were already store paths to be rewritten. Introduced by ab4c35982269e8f1f15e07afa7fedf65c749f276 in #94642 Example difference: $ echo "hello world" | tail -c+3 llo world $ str="hello world"; echo ${str:3} lo world --- pkgs/build-support/setup-hooks/patch-shebangs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/build-support/setup-hooks') diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index d0efe039ced..04ebcd2cc64 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -51,7 +51,7 @@ patchShebangs() { isScript "$f" || continue read -r oldInterpreterLine < "$f" - read -r oldPath arg0 args <<< "${oldInterpreterLine:3}" + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}" if [[ -z "$pathName" ]]; then if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then -- cgit 1.4.1