fix: common.sh: getvar: reset i
usually not a problem though? Signed-off-by: fukiame <fukiame@proton.me>
This commit is contained in:
parent
5a2fc21cc3
commit
d393998582
1 changed files with 1 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ strip_all() {
|
||||||
|
|
||||||
getvar() {
|
getvar() {
|
||||||
# Usage: getline "n" "pattern" "file"
|
# Usage: getline "n" "pattern" "file"
|
||||||
|
i=0
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
[ "$i" = "$1" ] && printf '%s\n' "${line##$2}" && return
|
[ "$i" = "$1" ] && printf '%s\n' "${line##$2}" && return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue