From: | Ulrich Mueller <ulm@g.o> | ||
---|---|---|---|
To: | gentoo-dev@l.g.o | ||
Cc: | "Michał Górny" <mgorny@g.o>, Jan Chren <dev.rindeal@×××××.com> | ||
Subject: | Re: [gentoo-dev] [PATCH] flag-o-matic.eclass: bugfix for get-flag() | ||
Date: | Sun, 15 May 2016 23:23:25 | ||
Message-Id: | 22329.1243.790672.211591@a1i15.kph.uni-mainz.de | ||
In Reply to: | Re: [gentoo-dev] [PATCH] flag-o-matic.eclass: bugfix for get-flag() by rindeal |
1 | >>>>> On Sun, 15 May 2016, rindeal wrote: |
2 | |
3 | [Looks like your mailer is broken. All the tabs in your patch have |
4 | been mangled and appear as spaces.] |
5 | |
6 | > + # reverse loop |
7 | > + set -- ${!var} |
8 | > + local i=${#} |
9 | > + while [[ ${i} > 0 ]] ; do |
10 | > + local arg="${!i}" |
11 | |
12 | Using the positional parameters looks needlessly complicated here. |
13 | Why not use an array, like this (untested): |
14 | |
15 | local -a flags=(${!var}) |
16 | for (( i=${#flags[@]}-1; i>=0; i-- )); do |
17 | |
18 | Below you can use ${flags[i]} instead of ${arg} then. |
19 | |
20 | Ulrich |
Subject | Author |
---|---|
Re: [gentoo-dev] [PATCH] flag-o-matic.eclass: bugfix for get-flag() | rindeal <dev.rindeal@×××××.com> |