summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-27 19:38:45 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-27 19:38:45 -0400
commitdf6fdceab0e120c6512ced21d0e07bcc48999368 (patch)
tree892a7f30f9327bb8585bac6027ca0ff77a1c7301 /src/lib
parent9a79c00aa45c2c1f9f8206ecfeaa2dbb4aae340c (diff)
libremessages: add some comments
Diffstat (limited to 'src/lib')
-rwxr-xr-xsrc/lib/libremessages6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libremessages b/src/lib/libremessages
index b89e2bc..188affd 100755
--- a/src/lib/libremessages
+++ b/src/lib/libremessages
@@ -40,6 +40,8 @@
# Own functions #
################################################################################
+# Usage: panic
+# For programming errors, bails immediately with little fanfare.
panic() {
echo "$(_l _ 'panic: malformed call to internal function')" >&2
exit 1
@@ -54,8 +56,8 @@ print() {
printf -- "$mesg\n" "$@"
}
-# Do HTML-style whitespace collapsing on standard IO. It considers newline,
-# tab, and space to be whitespace.
+# Do HTML-style whitespace collapsing on standard IO.
+# It considers newline, tab, and space to be whitespace.
_html_whitespace_collapse() {
[[ $# == 0 ]] || panic
tr '\n' ' ' | sed -r -e 's/\t/ /g' -e 's/ +/ /g'