From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2F561138334 for ; Sun, 21 Apr 2019 05:34:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 230BBE0ADD; Sun, 21 Apr 2019 05:34:07 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F1B99E0AD4 for ; Sun, 21 Apr 2019 05:34:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0578B341BC3 for ; Sun, 21 Apr 2019 05:34:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7D7105C7 for ; Sun, 21 Apr 2019 05:34:03 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1555824815.c88734624727231da02a3f610c9af0fda70fc1d0.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: init.d/ X-VCS-Repository: proj/netifrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: c88734624727231da02a3f610c9af0fda70fc1d0 X-VCS-Branch: master Date: Sun, 21 Apr 2019 05:34:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 97e6c75a-1348-4c70-8ee5-47491a1dbbdf X-Archives-Hash: c2dbee2fa8d8729fdd5fb077343605bf commit: c88734624727231da02a3f610c9af0fda70fc1d0 Author: Robin H. Johnson gentoo org> AuthorDate: Sun Apr 21 05:23:22 2019 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Sun Apr 21 05:33:35 2019 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=c8873462 init.d/net.lo.in: shellcheck: PROVIDEDBY MODULE trample This is a logic error caught by shellcheck. The nested loops used the same index variable, so the outer loop progress could get trampled. Signed-off-by: Robin H. Johnson gentoo.org> init.d/net.lo.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index 961d9fa..a958598 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -369,14 +369,14 @@ _gen_module_list() VISITED="${VISITED} $1" eval AFTER=\$${1}_after - for MODULE in ${AFTER}; do - eval PROVIDEDBY=\$${MODULE}_providedby + for MODULE1 in ${AFTER}; do + eval PROVIDEDBY=\$${MODULE1}_providedby if [ -n "${PROVIDEDBY}" ]; then - for MODULE in ${PROVIDEDBY}; do - visit "${MODULE}" + for MODULE2 in ${PROVIDEDBY}; do + visit "${MODULE2}" done else - visit "${MODULE}" + visit "${MODULE1}" fi done