stdenv/patchShebangs: fix off by one reading old interpreter

This caused shebangs that were already store paths to be rewritten.

Introduced by ab4c359822 in #94642

Example difference:

    $ echo "hello world" | tail -c+3
    llo world

    $ str="hello world"; echo ${str:3}
    lo world
This commit is contained in:
Andrew Childs 2021-02-09 12:51:42 +09:00
parent 2bd3aa4bc2
commit ca156a66b7

View File

@ -51,7 +51,7 @@ patchShebangs() {
isScript "$f" || continue isScript "$f" || continue
read -r oldInterpreterLine < "$f" read -r oldInterpreterLine < "$f"
read -r oldPath arg0 args <<< "${oldInterpreterLine:3}" read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"
if [[ -z "$pathName" ]]; then if [[ -z "$pathName" ]]; then
if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then