From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6921A13825A for ; Sun, 15 May 2016 23:23:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 20B591427B; Sun, 15 May 2016 23:23:17 +0000 (UTC) Received: from a1www.kph.uni-mainz.de (a1www.kph.uni-mainz.de [134.93.134.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF73D1420E for ; Sun, 15 May 2016 23:23:15 +0000 (UTC) Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1www.kph.uni-mainz.de (8.14.9/8.14.7) with ESMTP id u4FNN8gS026755; Mon, 16 May 2016 01:23:08 +0200 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.8/8.14.2) with ESMTP id u4FNN8Xc006798; Mon, 16 May 2016 01:23:08 +0200 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.8/8.14.8/Submit) id u4FNN8uY006794; Mon, 16 May 2016 01:23:08 +0200 Message-ID: <22329.1243.790672.211591@a1i15.kph.uni-mainz.de> Date: Mon, 16 May 2016 01:23:07 +0200 To: gentoo-dev@lists.gentoo.org Cc: =?iso-8859-2?Q?Micha=B3_G=F3rny?= , Jan Chren Subject: Re: [gentoo-dev] [PATCH] flag-o-matic.eclass: bugfix for get-flag() In-Reply-To: References: <1463319089-18877-1-git-send-email-dev.rindeal@gmail.com> <65DB30FD-2B31-45B6-B34D-021544C0E9D6@gentoo.org> X-Mailer: VM 8.2.0b under 24.3.1 (x86_64-pc-linux-gnu) From: Ulrich Mueller Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="pgp+signed+yncL6CT7+W+pBm/"; micalg=pgp-sha256; protocol="application/pgp-signature" X-Archives-Salt: 6b9bc04c-9f5b-470d-a1f7-ffa6197e5b9b X-Archives-Hash: e8612bd83fa42de19b1e5ad96bbcfc80 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --pgp+signed+yncL6CT7+W+pBm/ Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >>>>> On Sun, 15 May 2016, rindeal wrote: [Looks like your mailer is broken. All the tabs in your patch have been mangled and appear as spaces.] > + # reverse loop > + set -- ${!var} > + local i=${#} > + while [[ ${i} > 0 ]] ; do > + local arg="${!i}" Using the positional parameters looks needlessly complicated here. Why not use an array, like this (untested): local -a flags=(${!var}) for (( i=${#flags[@]}-1; i>=0; i-- )); do Below you can use ${flags[i]} instead of ${arg} then. Ulrich --pgp+signed+yncL6CT7+W+pBm/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBCAAGBQJXOQTaAAoJEMMJBoUcYcJzrY4H/A/ShDV32ucyZvzS2gW09eaN LvShsTEkmNt91jRnbvdG2wC5FB8MJ1hBxB+98WN0ITYkeG6JOFwYEQtdZyi0iLPN 9QG9GipoUe4ApHToWqUATqerSxGaGvoSoMSIJaauRnKInOHgnpHYN4RrzWsx/QHj UuefTQ3jHHcN7RjViwK+zOnsNKSeCID+zr3MDwY7tUyXrXxFHRdNcax88wXF9+3y a10yGYOdWiV8PRYE4NhMWuP6Hox2ebMfVNOPt7Cj5n3/CCh26M1LMSNmVXP9atFx ADP83otXhOSG9CStFy8KWaFH8mir5dpAIQGtlGbVwhDCzFUVTpbRBfjEhNchVWM= =w0Iw -----END PGP SIGNATURE----- --pgp+signed+yncL6CT7+W+pBm/--