commit:     1a1b2373220086a98ced0af6e43057819ab8833f
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Feb 17 03:11:35 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 07:37:00 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=1a1b2373

Don't try to write to a variable named arg upon being sourced

The consumer should be free to use this variable for their own purposes.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 functions.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/functions.sh b/functions.sh
index 02627d2..816acf4 100644
--- a/functions.sh
+++ b/functions.sh
@@ -481,13 +481,12 @@ RC_NOCOLOR="${RC_NOCOLOR:-no}"
 # Set the initial value for e-message indentation.
 genfun_indent=
 
-for arg in "$@" ; do
-       case "${arg}" in
-               # Lastly check if the user disabled it with --nocolor argument
+for _ in "$@"; do
+       case $_ in
+               # Check whether the user specifed an argument to disable color.
                --nocolor|--nocolour|-nc|-C)
                        RC_NOCOLOR="yes"
                        break
-                       ;;
        esac
 done
 

Reply via email to