projects
/
grml-etc-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
/etc/grml/lsb-functions: another few bugfixes by ft (thanks)
[grml-etc-core.git]
/
etc
/
grml
/
lsb-functions
diff --git
a/etc/grml/lsb-functions
b/etc/grml/lsb-functions
index
9f0e2f4
..
2aa0c77
100644
(file)
--- a/
etc/grml/lsb-functions
+++ b/
etc/grml/lsb-functions
@@
-100,7
+100,7
@@
log_end_msg() {
if _have_tput ; then
COLS="$("$TPUT" cols)"
if [ -n "$COLS" ]; then
if _have_tput ; then
COLS="$("$TPUT" cols)"
if [ -n "$COLS" ]; then
- COL=$((
"$COLS"
- 7 ))
+ COL=$((
$COLS
- 7 ))
else
COL=73
fi
else
COL=73
fi
@@
-182,12
+182,11
@@
esyslog() {
local pri
local tag
local pri
local tag
+ [ "$#" -le 2 ] && return 0
if [ -x /usr/bin/logger ] ; then
pri="$1"
tag="$2"
if [ -x /usr/bin/logger ] ; then
pri="$1"
tag="$2"
-
shift 2
shift 2
- [ "$#" -eq 0 ] && return 0
/usr/bin/logger -p "${pri}" -t "${tag}" -- "$@"
fi
/usr/bin/logger -p "${pri}" -t "${tag}" -- "$@"
fi
@@
-200,9
+199,9
@@
esyslog() {
# increase the indent used for e-commands.
#
eindent() {
# increase the indent used for e-commands.
#
eindent() {
- local i="$
1
"
+ local i="$
{1:-0}
"
[ "$i" -gt 0 ] || i="${RC_DEFAULT_INDENT}"
[ "$i" -gt 0 ] || i="${RC_DEFAULT_INDENT}"
- esetdent $(( ${#RC_INDENTATION} +
"$i"
))
+ esetdent $(( ${#RC_INDENTATION} +
$i
))
}
# void eoutdent(int num)
}
# void eoutdent(int num)
@@
-210,9
+209,9
@@
eindent() {
# decrease the indent used for e-commands.
#
eoutdent() {
# decrease the indent used for e-commands.
#
eoutdent() {
- local i="$
1
"
+ local i="$
{1:-0}
"
[ "$i" -gt 0 ] || i="${RC_DEFAULT_INDENT}"
[ "$i" -gt 0 ] || i="${RC_DEFAULT_INDENT}"
- esetdent $(( ${#RC_INDENTATION} -
"$i"
))
+ esetdent $(( ${#RC_INDENTATION} -
$i
))
}
# void esetdent(int num)
}
# void esetdent(int num)
@@
-221,7
+220,7
@@
eoutdent() {
# num defaults to 0
#
esetdent() {
# num defaults to 0
#
esetdent() {
- local i="$
1
"
+ local i="$
{1:-0}
"
[ "$i" -lt 0 ] && i=0
RC_INDENTATION="$(printf "%${i}s" '')"
}
[ "$i" -lt 0 ] && i=0
RC_INDENTATION="$(printf "%${i}s" '')"
}
@@
-296,7
+295,7
@@
ebegin() {
[ "${RC_QUIET_STDOUT}" = "yes" ] && return 0
if [ -n "${RC_DOT_PATTERN}" ]; then
[ "${RC_QUIET_STDOUT}" = "yes" ] && return 0
if [ -n "${RC_DOT_PATTERN}" ]; then
- dots="$(printf "%$((
"$COLS"
- 3 - ${#RC_INDENTATION} - ${#msg} - 7 ))s" '')"
+ dots="$(printf "%$((
$COLS
- 3 - ${#RC_INDENTATION} - ${#msg} - 7 ))s" '')"
while [ "${dots#${spaces}}" != "${dots}" ] ; do
dots="${dots#${spaces}}${RC_DOT_PATTERN}"
done
while [ "${dots#${spaces}}" != "${dots}" ] ; do
dots="${dots#${spaces}}${RC_DOT_PATTERN}"
done
@@
-338,7
+337,7
@@
_eend() {
printf "${ENDCOL} ${msg}\n"
else
[ "${LAST_E_CMD}" = "ebegin" ] || LAST_E_LEN=0
printf "${ENDCOL} ${msg}\n"
else
[ "${LAST_E_CMD}" = "ebegin" ] || LAST_E_LEN=0
- printf "%$((
"${COLS}" - "${LAST_E_LEN}"
- 6 ))s%b\n" '' "${msg}"
+ printf "%$((
${COLS} - ${LAST_E_LEN}
- 6 ))s%b\n" '' "${msg}"
fi
return "${retval}"
fi
return "${retval}"