commit:     173e25b61a7ccc838250280cd7cd2aa262484e57
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 28 01:06:18 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 29 02:03:18 2022 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=173e25b6

functions.sh: use consistent Gentoo style for braces

Signed-off-by: Sam James <sam <AT> gentoo.org>

 functions.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/functions.sh b/functions.sh
index 0b9e9cf..a5f3bfd 100644
--- a/functions.sh
+++ b/functions.sh
@@ -26,7 +26,7 @@ _esetdent()
 eindent()
 {
        local i="$1"
-       [ -n "$i" ] && [ "$i" -gt 0 ] || i=$RC_DEFAULT_INDENT
+       [ -n "$i" ] && [ "$i" -gt 0 ] || i=${RC_DEFAULT_INDENT}
        _esetdent $(( ${#RC_INDENTATION} + i ))
 }
 
@@ -36,7 +36,7 @@ eindent()
 eoutdent()
 {
        local i="$1"
-       [ -n "$i" ] && [ "$i" -gt 0 ] || i=$RC_DEFAULT_INDENT
+       [ -n "$i" ] && [ "$i" -gt 0 ] || i=${RC_DEFAULT_INDENT}
        _esetdent $(( ${#RC_INDENTATION} - i ))
 }
 
@@ -71,7 +71,7 @@ esyslog()
        local pri=
        local tag=
 
-       if [ -n "$EINFO_LOG" ] && command -v logger > /dev/null 2>&1; then
+       if [ -n "${EINFO_LOG}" ] && command -v logger > /dev/null 2>&1; then
                pri="$1"
                tag="$2"
 
@@ -424,10 +424,10 @@ done
 
 # Setup COLS and ENDCOL so eend can line up the [ ok ]
 COLS="${COLUMNS:-0}"            # bash's internal COLUMNS variable
-[ "$COLS" -eq 0 ] && \
+[ "${COLS}" -eq 0 ] && \
         COLS="$(set -- $(stty size 2>/dev/null) ; printf "$2\n")"
-[ -z "$COLS" ] && COLS=80
-[ "$COLS" -gt 0 ] || COLS=80   # width of [ ok ] == 7
+[ -z "${COLS}" ] && COLS=80
+[ "${COLS}" -gt 0 ] || COLS=80 # width of [ ok ] == 7
 
 if yesno "${RC_ENDCOL}"; then
        ENDCOL='\033[A\033['$(( COLS - 8 ))'C'

Reply via email to