Use par instead of fmt - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 2b194b6f79152bbea13f0e56bfebcf150a1050c6
(DIR) parent e910e592d237960e1046e9b1e50d08550c167c74
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sun, 16 Dec 2018 11:05:49
Use par instead of fmt
par can gracefully handle UTF-8 too, prefer it.
Diffstat:
twitter/tweets.dcgi | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff -r e910e592d237 -r 2b194b6f7915 twitter/tweets.dcgi
--- a/twitter/tweets.dcgi Sun Dec 16 10:59:54 2018 +0100
+++ b/twitter/tweets.dcgi Sun Dec 16 11:05:49 2018 +0100
@@ -53,9 +53,9 @@
{
awk -v base="${mbase}" -v cgi="${CGI}" -F "\t" \
'
- function print_fmt(text)
+ function print_tweettext(text)
{
- cmd = "fmt"
+ cmd = "par -d 0 -B=. -w 72"
cmd = cmd " | sed -e \"s/^/t/\""
print text | cmd
@@ -80,7 +80,7 @@
base,
t["item_username"],
id)
- print_fmt(t["text"])
+ print_tweettext(t["text"])
}
{