commit:     4f3b38f5c910980352c76de3f99b3bd4d6534cbc
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Feb 15 00:51:10 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 02:14:13 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=4f3b38f5

Drop the RC_DEFAULT_INDENT variable

Clearly, it's not intended to be configurable, otherwise it would have
been written as RC_DEFAULT_INDENT=${RC_DEFAULT_INDENT:-2}. It is only
expanded in two places, so things are made simpler by getting rid of it.
Doing so further increases the reliability of the library.

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

 functions.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/functions.sh b/functions.sh
index 19e4a37..c911fe3 100644
--- a/functions.sh
+++ b/functions.sh
@@ -29,7 +29,7 @@ _esetdent()
 eindent()
 {
        if ! is_int "$1" || [ "$1" -le 0 ]; then
-               set -- "${RC_DEFAULT_INDENT}"
+               set -- 2
        fi
        _esetdent "$(( ${#RC_INDENTATION} + $1 ))"
 }
@@ -40,7 +40,7 @@ eindent()
 eoutdent()
 {
        if ! is_int "$1" || [ "$1" -le 0 ]; then
-               set -- "${RC_DEFAULT_INDENT}"
+               set -- 2
        fi
        _esetdent "$(( ${#RC_INDENTATION} - $1 ))"
 }
@@ -489,9 +489,8 @@ RC_NOCOLOR="${RC_NOCOLOR:-no}"
 # Can the terminal handle endcols? Begin by assuming not.
 unset -v ENDCOL
 
-# Default values for e-message indentation and dots
-RC_INDENTATION=''
-RC_DEFAULT_INDENT=2
+# Set the initial value for e-message indentation.
+RC_INDENTATION=
 
 # If either STDOUT or STDERR is not a tty, disable coloured output. A useful
 # improvement for  the future would be to have the individual logging functions

Reply via email to