summaryrefslogtreecommitdiffstats
path: root/mantools/hchangered
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:46:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:46:30 +0000
commitb5896ba9f6047e7031e2bdee0622d543e11a6734 (patch)
treefd7b460593a2fee1be579bec5697e6d887ea3421 /mantools/hchangered
parentInitial commit. (diff)
downloadpostfix-b5896ba9f6047e7031e2bdee0622d543e11a6734.tar.xz
postfix-b5896ba9f6047e7031e2bdee0622d543e11a6734.zip
Adding upstream version 3.4.23.upstream/3.4.23upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xmantools/hchangered40
1 files changed, 40 insertions, 0 deletions
diff --git a/mantools/hchangered b/mantools/hchangered
new file mode 100755
index 0000000..044f2db
--- /dev/null
+++ b/mantools/hchangered
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# Usage: hchangered oldfile newfile
+
+# hchangered - crude tool to red-color changes in HTML text. Text is
+# also underlined so it shows on monochrome printers.
+
+# Bugs: does not red-color text inside tables. Fascist software may
+# complain about tags being out of order.
+
+diff -e $1 $2 | (sed -n -e '
+/[ac]$/{
+ p
+ a\
+<font color="red"><u>
+: loop
+ n
+ /^\.$/b done1
+ p
+ b loop
+: done1
+ a\
+</u></font>\
+.
+ b
+}
+/d$/{
+ a\
+ i\
+<font color="red"><u>[DELETED]</u></font>\
+.
+ p
+ b
+}
+'; echo '1,$p') | ed - $1 | perl -e '
+$buf = join("", <STDIN>);
+$buf =~ s/pre>\s+<font/pre><font/g;
+$buf =~ s/font>\s+<\/pre/font><\/pre/g;
+print $buf;
+'