Most `lesspipe' scripts can handle binary formats (using `hexdump -C' or
similar). Use `lesspipe' for binary files rather than simply dumping
the binary data directly.
---
src/src-hilite-lesspipe.sh.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/src-hilite-lesspipe.sh.in b/src/src-hilite-lesspipe.sh.in
index eb5c3ee..6c0beda 100644
--- a/src/src-hilite-lesspipe.sh.in
+++ b/src/src-hilite-lesspipe.sh.in
@@ -1,6 +1,10 @@
#! @SHELL@
for source in "$@"; do
+ if ! file -L "$source" | grep -q text; then
+ lesspipe "$source"
+ continue
+ fi
case $source in
*ChangeLog|*changelog)
source-highlight --failsafe -f esc --lang-def=changelog.lang
--style-file=esc.style -i "$source" ;;
--
1.7.9.5
_______________________________________________
Help-source-highlight mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-source-highlight