summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks
diff options
context:
space:
mode:
authorAndrew Childs <lorne@cons.org.nz>2021-02-09 12:51:42 +0900
committerAndrew Childs <lorne@cons.org.nz>2021-02-09 13:05:38 +0900
commitca156a66b75999153d746f57a11a19222fd5cdfb (patch)
tree6fa107af9488f962133d5b25297e2deba0ce0b47 /pkgs/build-support/setup-hooks
parent2bd3aa4bc265d34b8ab18e917261b0dc24c5076d (diff)
downloadnixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.tar
nixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.tar.gz
nixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.tar.bz2
nixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.tar.lz
nixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.tar.xz
nixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.tar.zst
nixpkgs-ca156a66b75999153d746f57a11a19222fd5cdfb.zip
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
Diffstat (limited to 'pkgs/build-support/setup-hooks')
-rw-r--r--pkgs/build-support/setup-hooks/patch-shebangs.sh2
1 files changed, 1 insertions, 1 deletions
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