summaryrefslogtreecommitdiff
path: root/src/lib/librelib
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-05-26 20:18:00 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-05-26 20:18:00 -0400
commita608070d29143f11826725ae0261bf0dcd902bc2 (patch)
tree33f860856dcdaba452a0cf60257ca87be1dd1804 /src/lib/librelib
parentabf473294025868faac6e6c82f01b236c399f524 (diff)
Rename libremessages:whitespace-collapse to whitespace_collapse.v20150526
When using /bin/sh instead of bash (a terrible idea, but whatev), the '-' is an invalid charater in an identifier.
Diffstat (limited to 'src/lib/librelib')
-rwxr-xr-xsrc/lib/librelib4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/librelib b/src/lib/librelib
index bc5c5ed..e9d184e 100755
--- a/src/lib/librelib
+++ b/src/lib/librelib
@@ -34,14 +34,14 @@ print() {
printf -- "$mesg\n" "$@"
}
-whitespace-collapse() {
+whitespace_collapse() {
tr '\n' '\r' | sed -r \
-e 's/\r/ /g' -e 's/\t/ /g' \
-e 's/(^|[^.!? ]) +/\1 /g' -e 's/([.!?]) +/\1 /g'
}
prose() {
- local mesg="$(_ "$(whitespace-collapse <<<"$1")")"; shift
+ local mesg="$(_ "$(whitespace_collapse <<<"$1")")"; shift
printf -- "$mesg" "$@" | fmt -u
}